import-font.h 1007 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <cstdlib>
  3. #include "../core/Shape.h"
  4. namespace msdfgen {
  5. class FreetypeHandle;
  6. class FontHandle;
  7. /// Initializes the FreeType library
  8. FreetypeHandle * initializeFreetype();
  9. /// Deinitializes the FreeType library
  10. void deinitializeFreetype(FreetypeHandle *library);
  11. /// Loads a font file and returns its handle
  12. FontHandle * loadFont(FreetypeHandle *library, const char *filename);
  13. /// Unloads a font file
  14. void destroyFont(FontHandle *font);
  15. /// Returns the size of one EM in the font's coordinate system
  16. bool getFontScale(double &output, FontHandle *font);
  17. /// Returns the width of space and tab
  18. bool getFontWhitespaceWidth(double &spaceAdvance, double &tabAdvance, FontHandle *font);
  19. /// Loads the shape prototype of a glyph from font file
  20. bool loadGlyph(Shape &output, FontHandle *font, int unicode, double *advance = NULL);
  21. /// Returns the kerning distance adjustment between two specific glyphs.
  22. bool getKerning(double &output, FontHandle *font, int unicode1, int unicode2);
  23. }