首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >libRocket需要哪些FreeType2库模块?

libRocket需要哪些FreeType2库模块?
EN

Stack Overflow用户
提问于 2014-06-03 19:28:46
回答 1查看 240关注 0票数 1

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

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

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

EN

回答 1

Stack Overflow用户

发布于 2014-06-04 02:15:45

对于任何以FT_开头的内容,在librocket的源代码目录中使用"GREPing“都会产生以下结果:

代码语言:javascript
运行
复制
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);

快速浏览一下列表,我列出了以下函数:

代码语言:javascript
运行
复制
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没有足够的了解,无法告诉你这些函数属于哪些模块,但我认为你可以从documentation中弄清楚。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24014016

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档