XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
ttf.cpp File Reference
#include <sys/utf.h>
#include "ttf.h"
Include dependency graph for ttf.cpp:

Classes

struct  _ttf_vertices_
 

Macros

#define GLYF_FLAG_ONCURVE   (1<<0)
 
#define GLYF_FLAG_XSHORT_VECT   (1<<1)
 
#define GLYF_FLAG_YSHORT_VECT   (1<<2)
 
#define GLYF_FLAG_REPEAT   (1<<3)
 
#define GLYF_FLAG_POSITIVE_XSHORT_VECT   (1<<4)
 
#define GLYF_FLAG_POSITIVE_YSHORT_VECT   (1<<5)
 
#define ARG_1_AND_2_ARE_WORDS   (1<<0)
 
#define ARGS_ARE_XY_VALUES   (1<<1)
 
#define ROUND_XY_TO_GRID   (1<<2)
 
#define WE_HAVE_A_SCALE   (1<<3)
 
#define MORE_COMPONENTS   (1<<5)
 
#define WE_HAVE_AN_X_AND_Y_SCALE   (1<<6)
 
#define WE_HAVE_A_TWO_BY_TWO   (1<<7)
 
#define WE_HAVE_INSTRUCTIONS   (1<<8)
 
#define USE_MY_METRICS   (1<<9)
 
#define OVERLAP_COMPUND   (1<<10)
 

Typedefs

typedef struct _ttf_vertices_ TTFVertices
 

Functions

int TTFSwap32 (int value)
 
uint16_t TTFSwap16 (uint16_t value)
 
uint8_t TTF_READ_8 (TTFont *f)
 
uint16_t TTF_READ_16 (TTFont *f)
 
uint32_t UTF8toUnicode (uint8_t c)
 
void TTFSetFontSize (TTFont *font, float pointSz)
 
uint32_t TTFGetGlyph (TTFont *font, uint32_t codepoint)
 
void TTFDrawSimpleGlyf (TTFont *font, uint32_t glyphOffset, float xoff, float yoff)
 
void TTFDrawGlyph (TTFont *font, uint32_t glyph, int xOff, int yOff)
 
TTFontTTFLoadFont (ChCanvas *canv, unsigned char *buffer)
 

Macro Definition Documentation

◆ ARG_1_AND_2_ARE_WORDS

#define ARG_1_AND_2_ARE_WORDS   (1<<0)

◆ ARGS_ARE_XY_VALUES

#define ARGS_ARE_XY_VALUES   (1<<1)

◆ GLYF_FLAG_ONCURVE

#define GLYF_FLAG_ONCURVE   (1<<0)

BSD 2-Clause License

Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ GLYF_FLAG_POSITIVE_XSHORT_VECT

#define GLYF_FLAG_POSITIVE_XSHORT_VECT   (1<<4)

◆ GLYF_FLAG_POSITIVE_YSHORT_VECT

#define GLYF_FLAG_POSITIVE_YSHORT_VECT   (1<<5)

◆ GLYF_FLAG_REPEAT

#define GLYF_FLAG_REPEAT   (1<<3)

◆ GLYF_FLAG_XSHORT_VECT

#define GLYF_FLAG_XSHORT_VECT   (1<<1)

◆ GLYF_FLAG_YSHORT_VECT

#define GLYF_FLAG_YSHORT_VECT   (1<<2)

◆ MORE_COMPONENTS

#define MORE_COMPONENTS   (1<<5)

◆ OVERLAP_COMPUND

#define OVERLAP_COMPUND   (1<<10)

◆ ROUND_XY_TO_GRID

#define ROUND_XY_TO_GRID   (1<<2)

◆ USE_MY_METRICS

#define USE_MY_METRICS   (1<<9)

◆ WE_HAVE_A_SCALE

#define WE_HAVE_A_SCALE   (1<<3)

◆ WE_HAVE_A_TWO_BY_TWO

#define WE_HAVE_A_TWO_BY_TWO   (1<<7)

◆ WE_HAVE_AN_X_AND_Y_SCALE

#define WE_HAVE_AN_X_AND_Y_SCALE   (1<<6)

◆ WE_HAVE_INSTRUCTIONS

#define WE_HAVE_INSTRUCTIONS   (1<<8)

Typedef Documentation

◆ TTFVertices

typedef struct _ttf_vertices_ TTFVertices

Function Documentation

◆ TTF_READ_16()

uint16_t TTF_READ_16 ( TTFont f)

◆ TTF_READ_8()

uint8_t TTF_READ_8 ( TTFont f)

◆ TTFDrawGlyph()

void TTFDrawGlyph ( TTFont font,
uint32_t  glyph,
int  xOff,
int  yOff 
)

◆ TTFDrawSimpleGlyf()

void TTFDrawSimpleGlyf ( TTFont font,
uint32_t  glyphOffset,
float  xoff,
float  yoff 
)

◆ TTFGetGlyph()

uint32_t TTFGetGlyph ( TTFont font,
uint32_t  codepoint 
)

◆ TTFLoadFont()

TTFont * TTFLoadFont ( ChCanvas canv,
unsigned char *  buffer 
)

◆ TTFSetFontSize()

void TTFSetFontSize ( TTFont font,
float  pointSz 
)

◆ TTFSwap16()

uint16_t TTFSwap16 ( uint16_t  value)

◆ TTFSwap32()

int TTFSwap32 ( int  value)

◆ UTF8toUnicode()

uint32_t UTF8toUnicode ( uint8_t  c)