#include #include //using namespace std; #include #include "ft2build.h" #include FT_FREETYPE_H #include FT_LIST_H #include "freetype/internal/internal.h" #include FT_INTERNAL_TRUETYPE_TYPES_H #include FT_TRUETYPE_TAGS_H #include "freetype/winfnt.h" #include FT_INTERNAL_SFNT_H #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_SFNT_H #include FT_TRUETYPE_TABLES_H #include FT_TRUETYPE_IDS_H #include FT_SFNT_NAMES_H #include FT_TRUETYPE_TABLES_H #pragma warning (disable : 4800) // Disable the bool warning. #pragma warning (disable : 4211) #include int main(int argc, char** argv) { FT_Library library; FT_Face face; int error = FT_Init_FreeType(&library); if (error) { std::cout << "an error occurred during library initialization" << std::endl; } error = FT_New_Face(library, "C:\\defects\\DE357940\\arial.ttf", 0, &face); if (error == FT_Err_Unknown_File_Format) { std::cout << "the font file could be opened and read, but it appears\ that its font format is unsupported" << std::endl; } else if (error) { std::cout << "another error code means that the font file could not\ ... be opened or read, or that it is broken" << std::endl; } TT_Face ttfcTrueTypeFace = (TT_Face)face; int nGlyphCount = ttfcTrueTypeFace->num_locations; int ulGlyphOffset = 0; std::ofstream myfile; myfile.open("C:\\test\\freetype2.10.0.txt"); myfile << "Writing this to a file.\n"; for (int i = 0; i < nGlyphCount; i++) { ulGlyphOffset = ttfcTrueTypeFace->glyph_locations[i]; myfile << ulGlyphOffset; myfile << "\n"; } myfile.close(); }