glue.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #include <ft2build.h>
  2. #include FT_FREETYPE_H
  3. #include "brl.mod/blitz.mod/blitz.h"
  4. int bmx_freetype_Face_numglyphs(FT_Face ft_face) {
  5. return ft_face->num_glyphs;
  6. }
  7. FT_GlyphSlot bmx_freetype_Face_glyph(FT_Face ft_face) {
  8. return ft_face->glyph;
  9. }
  10. FT_Size bmx_freetype_Face_size(FT_Face ft_face) {
  11. return ft_face->size;
  12. }
  13. int bmx_freetype_Size_height(FT_Size size) {
  14. return size->metrics.height;
  15. }
  16. int bmx_freetype_Size_ascend(FT_Size size) {
  17. return size->metrics.ascender;
  18. }
  19. int bmx_freetype_Size_descend(FT_Size size) {
  20. return size->metrics.descender;
  21. }
  22. int bmx_freetype_Slot_bitmapleft(FT_GlyphSlot slot) {
  23. return slot->bitmap_left;
  24. }
  25. int bmx_freetype_Slot_bitmaptop(FT_GlyphSlot slot) {
  26. return slot->bitmap_top;
  27. }
  28. int bmx_freetype_Slot_bitmap_width(FT_GlyphSlot slot) {
  29. return slot->bitmap.width;
  30. }
  31. int bmx_freetype_Slot_bitmap_rows(FT_GlyphSlot slot) {
  32. return slot->bitmap.rows;
  33. }
  34. int bmx_freetype_Slot_bitmap_pitch(FT_GlyphSlot slot) {
  35. return slot->bitmap.pitch;
  36. }
  37. int bmx_freetype_Slot_bitmap_numgreys(FT_GlyphSlot slot) {
  38. return slot->bitmap.num_grays;
  39. }
  40. int bmx_freetype_Slot_advance_x(FT_GlyphSlot slot) {
  41. return slot->advance.x;
  42. }
  43. unsigned char * bmx_freetype_Slot_bitmap_buffer(FT_GlyphSlot slot) {
  44. return slot->bitmap.buffer;
  45. }
  46. BBString * bmx_freetype_Face_family_name(FT_Face ft_face) {
  47. return bbStringFromUTF8String((unsigned char*)ft_face->family_name);
  48. }
  49. BBString * bmx_freetype_Face_style_name(FT_Face ft_face) {
  50. return bbStringFromUTF8String((unsigned char*)ft_face->style_name);
  51. }