Subversion Repositories Kolibri OS

Rev

Rev 5515 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. // Truetype library
  2.  
  3. dword libtruetype = #att_libtruetype;
  4. char att_libtruetype[22] = "/sys/lib/truetype.obj\0";
  5.  
  6. dword truetype = #att_truetype;      // truetype(unsigned char *s, stbtt_fontinfo *buffer, char *screen1, int width, int height)
  7. dword get_length = #att_get_length;  // get_length(unsigned char *s, char *buffer, int height, int max_len)
  8. dword get_width  = #att_get_width;   // get_width_utf8(unsigned char *s, stbtt_fontinfo *buffer, int height)
  9. dword text_out = #att_text_out;      // text_out(unsigned char *string, char *buffer, int height, int color,int back_color, int x, int y)
  10. dword init_font = #att_init_font;    // init_font(stbtt_fontinfo *font,unsigned char *FontData)
  11. dword text_out_mem = #att_text_out_mem; // text_out_mem(unsigned char *string, stbtt_fontinfo *buffer, int height, int color,int back_color)
  12. $DD 2 dup 0
  13.  
  14. char att_truetype[]     = "truetype";
  15. char att_get_length[]   = "get_length";
  16. char att_get_width[]    = "get_width";
  17. char att_text_out[]     = "text_out";
  18. char att_text_out_mem[] = "text_out_mem";
  19. char att_init_font[]    = "init_font";
  20.  
  21. //============================================================
  22. //============================================================
  23.  
  24. char fontinfo[28];
  25.  
  26. struct stbtt_fontinfo
  27. {
  28.         dword userdata;
  29.         dword data;            // pointer to .ttf file
  30.         int fontstart;         // offset of start of font
  31.        
  32.         int numGlyphs;                     // number of glyphs, needed for range checking
  33.        
  34.         int loca,head,glyf,hhea,hmtx,kern; // table locations as offset from start of .ttf
  35.         int index_map;                     // a cmap mapping for our chosen character encoding
  36.         int indexToLocFormat;              // format needed to map from glyph index to glyph
  37. };
  38.