Created
June 24, 2015 04:57
-
-
Save k4b7/fa5e9ed342c928a0f31f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #include <ft2build.h> | |
| #include FT_FREETYPE_H | |
| FT_Library library; | |
| FT_Face face; | |
| FT_Error error; | |
| int main(void) { | |
| FT_Init_FreeType(&library); | |
| FT_New_Face(library, "KaTeX_Main-Regular.ttf", 0, &face); | |
| int code_point; | |
| FT_UInt index; | |
| code_point = 0x22a5; // up tack | |
| index = FT_Get_Char_Index(face, code_point); | |
| printf("%x: %u\n", code_point, index); | |
| code_point = 0x27c2; // perpendicular | |
| index = FT_Get_Char_Index(face, code_point); | |
| printf("%x: %u\n", code_point, index); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
output:
The glyph index. 0 means ‘undefined character code’.