1

HTML/CSS UI 构建器libRocket依赖于FreeType2库。但是,FreeType2包含许多在编译时可以禁用的可选模块。

最小化分布式二进制文件的大小对于移动平台尤其重要。

依赖于哪些FreeType2模块?libRocket哪些模块可以安全禁用?

4

1 回答 1

0

librocket 源代码目录中的“GREPing”,用于任何以yield 开头的内容FT_

Core/FontDatabase.cpp   |33  col 10| #include FT_FREETYPE_H
Core/FontDatabase.cpp   |43  col 8 | static FT_Library ft_library = NULL;
Core/FontDatabase.cpp   |63  col 3 | FT_Error result = FT_Init_FreeType(&ft_library);
Core/FontDatabase.cpp   |63  col 21| FT_Error result = FT_Init_FreeType(&ft_library);
Core/FontDatabase.cpp   |84  col 4 | FT_Done_FreeType(ft_library);
Core/FontDatabase.cpp   |95  col 2 | FT_Face ft_face = (FT_Face) instance->LoadFace(file_name);
Core/FontDatabase.cpp   |95  col 21| FT_Face ft_face = (FT_Face) instance->LoadFace(file_name);
Core/FontDatabase.cpp   |102 col 45| Font::Style style = ft_face->style_flags & FT_STYLE_FLAG_ITALIC ? Font::STYLE_ITALIC : Font::STYLE_NORMAL;
Core/FontDatabase.cpp   |103 col 47| Font::Weight weight = ft_face->style_flags & FT_STYLE_FLAG_BOLD ? Font::WEIGHT_BOLD : Font::WEIGHT_NORMAL;
Core/FontDatabase.cpp   |120 col 2 | FT_Face ft_face = (FT_Face) instance->LoadFace(file_name);
Core/FontDatabase.cpp   |120 col 21| FT_Face ft_face = (FT_Face) instance->LoadFace(file_name);
Core/FontDatabase.cpp   |142 col 2 | FT_Face ft_face = (FT_Face) instance->LoadFace(data, data_length, "memory", false);
Core/FontDatabase.cpp   |142 col 21| FT_Face ft_face = (FT_Face) instance->LoadFace(data, data_length, "memory", false);
Core/FontDatabase.cpp   |149 col 45| Font::Style style = ft_face->style_flags & FT_STYLE_FLAG_ITALIC ? Font::STYLE_ITALIC : Font::STYLE_NORMAL;
Core/FontDatabase.cpp   |150 col 47| Font::Weight weight = ft_face->style_flags & FT_STYLE_FLAG_BOLD ? Font::WEIGHT_BOLD : Font::WEIGHT_NORMAL;
Core/FontDatabase.cpp   |167 col 2 | FT_Face ft_face = (FT_Face) instance->LoadFace(data, data_length, "memory", false);
Core/FontDatabase.cpp   |167 col 21| FT_Face ft_face = (FT_Face) instance->LoadFace(data, data_length, "memory", false);
Core/FontDatabase.cpp   |271 col 31| return font_family->AddFace((FT_Face) face, style, weight, release_stream);
Core/FontDatabase.cpp   |287 col 2 | FT_Byte* buffer = new FT_Byte[length];
Core/FontDatabase.cpp   |287 col 24| FT_Byte* buffer = new FT_Byte[length];
Core/FontDatabase.cpp   |297 col 2 | FT_Face face = NULL;
Core/FontDatabase.cpp   |298 col 14| int error = FT_New_Memory_Face(ft_library, (const FT_Byte*) data, data_length, 0, &face);
Core/FontDatabase.cpp   |298 col 52| int error = FT_New_Memory_Face(ft_library, (const FT_Byte*) data, data_length, 0, &face);
Core/FontDatabase.cpp   |311 col 3 | FT_Select_Charmap(face, FT_ENCODING_APPLE_ROMAN);
Core/FontDatabase.cpp   |311 col 27| FT_Select_Charmap(face, FT_ENCODING_APPLE_ROMAN);
Core/FontDatabase.cpp   |315 col 4 | FT_Done_Face(face);
Core/FontFace.cpp       |36  col 20| FontFace::FontFace(FT_Face _face, Font::Style _style, Font::Weight _weight, bool _release_stream)
Core/FontFace.cpp       |149 col 3 | FT_Byte* face_memory = face->stream->base;
Core/FontFace.cpp       |150 col 3 | FT_Done_Face(face);
Core/FontFaceHandle.cpp |71  col 33| bool FontFaceHandle::Initialise(FT_Face ft_face, const String& _charset, int _size)
Core/FontFaceHandle.cpp |83  col 2 | FT_Error error = FT_Set_Char_Size(ft_face, 0, size << 6, 0, 0);
Core/FontFaceHandle.cpp |83  col 19| FT_Error error = FT_Set_Char_Size(ft_face, 0, size << 6, 0, 0);
Core/FontFaceHandle.cpp |356 col 38| void FontFaceHandle::GenerateMetrics(FT_Face ft_face)
Core/FontFaceHandle.cpp |361 col 23| underline_position = FT_MulFix(ft_face->underline_position, ft_face->size->metrics.y_scale) / float(1 << 6);
Core/FontFaceHandle.cpp |362 col 24| underline_thickness = FT_MulFix(ft_face->underline_thickness, ft_face->size->metrics.y_scale) / float(1 << 6);
Core/FontFaceHandle.cpp |382 col 14| int index = FT_Get_Char_Index(ft_face, x);
Core/FontFaceHandle.cpp |383 col 6 | if (FT_Load_Glyph(ft_face, index, 0) == 0)
Core/FontFaceHandle.cpp |389 col 36| void FontFaceHandle::BuildGlyphMap(FT_Face ft_face, const UnicodeRange& unicode_range)
Core/FontFaceHandle.cpp |394 col 15| int index = FT_Get_Char_Index(ft_face, character_code);
Core/FontFaceHandle.cpp |397 col 4 | FT_Error error = FT_Load_Glyph(ft_face, index, 0);
Core/FontFaceHandle.cpp |397 col 21| FT_Error error = FT_Load_Glyph(ft_face, index, 0);
Core/FontFaceHandle.cpp |405 col 12| error = FT_Render_Glyph(ft_face->glyph, FT_RENDER_MODE_NORMAL);
Core/FontFaceHandle.cpp |405 col 44| error = FT_Render_Glyph(ft_face->glyph, FT_RENDER_MODE_NORMAL);
Core/FontFaceHandle.cpp |421 col 51| void FontFaceHandle::BuildGlyph(FontGlyph& glyph, FT_GlyphSlot ft_glyph)
Core/FontFaceHandle.cpp |442 col 38| if (ft_glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO &&
Core/FontFaceHandle.cpp |443 col 35| ft_glyph->bitmap.pixel_mode != FT_PIXEL_MODE_GRAY)
Core/FontFaceHandle.cpp |460 col 10| case FT_PIXEL_MODE_MONO:
Core/FontFaceHandle.cpp |488 col 10| case FT_PIXEL_MODE_GRAY:
Core/FontFaceHandle.cpp |505 col 35| void FontFaceHandle::BuildKerning(FT_Face ft_face)
Core/FontFaceHandle.cpp |508 col 6 | if (FT_HAS_KERNING(ft_face))
Core/FontFaceHandle.cpp |522 col 7 | FT_Vector ft_kerning;
Core/FontFaceHandle.cpp |523 col 7 | FT_Get_Kerning(ft_face, FT_Get_Char_Index(ft_face, lhs), FT_Get_Char_Index(ft_face, rhs), FT_KERNING_DEFAULT, &ft_kerning);
Core/FontFaceHandle.cpp |523 col 31| FT_Get_Kerning(ft_face, FT_Get_Char_Index(ft_face, lhs), FT_Get_Char_Index(ft_face, rhs), FT_KERNING_DEFAULT, &ft_kerning);
Core/FontFaceHandle.cpp |523 col 64| FT_Get_Kerning(ft_face, FT_Get_Char_Index(ft_face, lhs), FT_Get_Char_Index(ft_face, rhs), FT_KERNING_DEFAULT, &ft_kerning);
Core/FontFaceHandle.cpp |523 col 97| FT_Get_Kerning(ft_face, FT_Get_Char_Index(ft_face, lhs), FT_Get_Char_Index(ft_face, rhs), FT_KERNING_DEFAULT, &ft_kerning);
Core/FontFamily.cpp     |46  col 26| bool FontFamily::AddFace(FT_Face ft_face, Font::Style style, Font::Weight weight, bool release_stream)
Core/FontFace.h         |33  col 10| #include FT_FREETYPE_H
Core/FontFace.h         |48  col 11| FontFace(FT_Face face, Font::Style style, Font::Weight weight, bool release_stream);
Core/FontFace.h         |71  col 2 | FT_Face face;
Core/FontFaceHandle.h   |40  col 10| #include FT_FREETYPE_H
Core/FontFaceHandle.h   |63  col 18| bool Initialise(FT_Face ft_face, const String& charset, int size);
Core/FontFaceHandle.h   |138 col 23| void GenerateMetrics(FT_Face ft_face);
Core/FontFaceHandle.h   |140 col 21| void BuildGlyphMap(FT_Face ft_face, const UnicodeRange& unicode_range);
Core/FontFaceHandle.h   |141 col 36| void BuildGlyph(FontGlyph& glyph, FT_GlyphSlot ft_glyph);
Core/FontFaceHandle.h   |143 col 20| void BuildKerning(FT_Face ft_face);
Core/FontFamily.h       |33  col 10| #include FT_FREETYPE_H
Core/FontFamily.h       |57  col 15| bool AddFace(FT_Face ft_face, Font::Style style, Font::Weight weight, bool release_stream);

快速浏览整个列表,我已经使用了这些功能:

FT_Init_FreeType
FT_Done_FreeType
FT_New_Memory_Face
FT_Done_Face
FT_Select_Charmap
FT_Set_Char_Size
FT_MulFix
FT_Get_Char_Index
FT_Load_Glyph
FT_Render_Glyph
FT_Get_Kerning

我对 Freetype 的了解不够,无法告诉您这些功能属于哪些模块,但我认为您可以从文档中弄清楚。

于 2014-06-03T18:15:44.923 回答