mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 20:59:36 +08:00
Fixed training build
This commit is contained in:
parent
81b67f7ed9
commit
941d87057e
@ -617,6 +617,10 @@ class UNICHARSET {
|
||||
unichars[unichar_id].properties.max_advance =
|
||||
static_cast<inT16>(ClipToRange(max_advance, 0, MAX_INT16));
|
||||
}
|
||||
// Returns true if the font metrics properties are empty.
|
||||
bool PropertiesIncomplete(UNICHAR_ID unichar_id) const {
|
||||
return unichars[unichar_id].properties.AnyRangeEmpty();
|
||||
}
|
||||
|
||||
// Return the script name of the given unichar.
|
||||
// The returned pointer will always be the same for the same script, it's
|
||||
|
@ -243,7 +243,7 @@ text2image_LDADD += \
|
||||
../api/libtesseract.la
|
||||
endif
|
||||
text2image_LDADD += $(libicu) -lpango-1.0 -lpangocairo-1.0 \
|
||||
-lgobject-2.0 -lglib-2.0 -lcairo -lpangoft2-1.0
|
||||
-lgobject-2.0 -lglib-2.0 -lcairo -lpangoft2-1.0 -lfontconfig
|
||||
|
||||
unicharset_extractor_SOURCES = unicharset_extractor.cpp
|
||||
#unicharset_extractor_LDFLAGS = -static
|
||||
|
@ -161,7 +161,7 @@ void PangoFontInfo::InitFontConfig(bool force_clear, const string& fonts_dir) {
|
||||
|
||||
static void ListFontFamilies(PangoFontFamily*** families,
|
||||
int* n_families) {
|
||||
PangoFontInfo::InitFontConfig(false, FLAGS_fonts_dir);
|
||||
PangoFontInfo::InitFontConfig(false, FLAGS_fonts_dir.c_str());
|
||||
PangoFontMap* font_map = pango_cairo_font_map_get_default();
|
||||
DISABLE_HEAP_LEAK_CHECK;
|
||||
pango_font_map_list_families(font_map, families, n_families);
|
||||
@ -235,7 +235,7 @@ bool PangoFontInfo::ParseFontDescriptionName(const string& name) {
|
||||
// in the font map. Note that if the font is wholly missing, this could
|
||||
// correspond to a completely different font family and face.
|
||||
PangoFont* PangoFontInfo::ToPangoFont() const {
|
||||
InitFontConfig(false, FLAGS_fonts_dir);
|
||||
InitFontConfig(false, FLAGS_fonts_dir.c_str());
|
||||
PangoFontMap* font_map = pango_cairo_font_map_get_default();
|
||||
PangoContext* context = pango_context_new();
|
||||
pango_cairo_context_set_resolution(context, resolution_);
|
||||
@ -512,7 +512,7 @@ bool FontUtils::IsAvailableFont(const char* input_query_desc,
|
||||
query_desc.c_str());
|
||||
PangoFont* selected_font = NULL;
|
||||
{
|
||||
PangoFontInfo::InitFontConfig(false, FLAGS_fonts_dir);
|
||||
PangoFontInfo::InitFontConfig(false, FLAGS_fonts_dir.c_str());
|
||||
PangoFontMap* font_map = pango_cairo_font_map_get_default();
|
||||
PangoContext* context = pango_context_new();
|
||||
pango_context_set_font_map(context, font_map);
|
||||
|
@ -630,7 +630,8 @@ int main(int argc, char** argv) {
|
||||
box_name += ".box";
|
||||
render.WriteAllBoxes(box_name);
|
||||
} else if (!FLAGS_render_per_font && !font_names.empty()) {
|
||||
string filename = FLAGS_outputbase + ".fontlist.txt";
|
||||
string filename = FLAGS_outputbase.c_str();
|
||||
filename += ".fontlist.txt";
|
||||
FILE* fp = fopen(filename.c_str(), "wb");
|
||||
if (fp == NULL) {
|
||||
tprintf("Failed to create output font list %s\n", filename.c_str());
|
||||
|
Loading…
Reference in New Issue
Block a user