Skip to content

Commit

Permalink
[11_29] Logging on font substitution
Browse files Browse the repository at this point in the history
  • Loading branch information
沈浪熊猫儿 committed Jan 17, 2024
1 parent fc9126d commit 44c04a1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Graphics/Fonts/font_translate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "Freetype/tt_tools.hpp"
#include "analyze.hpp"
#include "font.hpp"
#include "tm_debug.hpp"

bool is_weight (string s);
bool is_category (string s);
Expand Down Expand Up @@ -290,7 +291,14 @@ closest_font (string family, string variant, string series, string shape,
string s= family * "-" * variant * "-" * series * "-" * shape * "-" *
as_string (sz) * "-" * as_string (dpi) * "-" * as_string (attempt);
if (font::instances->contains (s)) return font (s);
string orig_family= family;
find_closest (family, variant, series, shape, attempt);
if (orig_family != family) {
debug_fonts << "Font substitution: " << s << LF
<< "-> " << family * "-" * variant * "-" * series * "-" * shape << "-"
<< as_string (sz) * "-" * as_string (dpi) * "-" * as_string (attempt)
<< LF;
}
font fn= find_font (family, variant, series, shape, sz, dpi);
// cout << "Found " << fn->res_name << "\n";
font::instances (s)= (pointer) fn.rep;
Expand Down

0 comments on commit 44c04a1

Please sign in to comment.