summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp35
-rw-r--r--Build/source/texk/web2c/xetexdir/XeTeX_ext.c7
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex.ch33
3 files changed, 43 insertions, 32 deletions
diff --git a/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp b/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp
index 4e88c896451..70913b368e0 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp
+++ b/Build/source/texk/web2c/xetexdir/XeTeXFontMgr.cpp
@@ -49,8 +49,6 @@ extern Fixed loadedfontdesignsize;
extern "C" {
void zprintnl(int s);
void zprintchar(int c);
- void zprintint(int i);
- void zprintscaled(int sc);
void begindiagnostic();
void zenddiagnostic(int nl);
int gettracingfontsstate();
@@ -108,32 +106,9 @@ XeTeXFontMgr::findFont(const char* name, char* variant, double ptSize)
{
std::string nameStr(name);
Font* font = NULL;
- int tracing = gettracingfontsstate();
-
int dsize = 100;
loadedfontdesignsize = 655360L;
- if (tracing > 0) {
- begindiagnostic();
- zprintnl('F');
- printcstring("ont \"");
- printcstring(name);
- if (variant != NULL) {
- printcstring("/");
- printcstring(variant);
- }
- printcstring("\"");
- if (ptSize < 0) {
- printcstring(" scaled ");
- zprintint(X2Fix(-ptSize));
- }
- else {
- printcstring(" at ");
- zprintscaled(X2Fix(ptSize));
- printcstring("pt");
- }
- }
-
for (int pass = 0; pass < 2; ++pass) {
// try full name as given
std::map<std::string,Font*>::iterator i = nameToFont.find(nameStr);
@@ -224,13 +199,8 @@ XeTeXFontMgr::findFont(const char* name, char* variant, double ptSize)
}
}
- if (font == NULL) {
- if (tracing > 0) {
- printcstring(" not found");
- zenddiagnostic(0);
- }
+ if (font == NULL)
return 0;
- }
Family* parent = font->parent;
@@ -437,7 +407,8 @@ XeTeXFontMgr::findFont(const char* name, char* variant, double ptSize)
if (font != NULL && font->opSizeInfo.designSize != 0)
loadedfontdesignsize = (font->opSizeInfo.designSize << 16L) / 10;
- if (tracing > 0) {
+ if (gettracingfontsstate() > 0) {
+ begindiagnostic();
zprintnl(' ');
printcstring("-> ");
printcstring(getPlatformFontDesc(font->fontRef).c_str());
diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c
index f0227ec52c7..3257ea1f7c0 100644
--- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c
+++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c
@@ -1309,6 +1309,13 @@ findnativefont(unsigned char* uname, integer scaled_size)
rval = loadOTfont(0, font, scaled_size, featString);
if (rval == NULL)
deleteFont(font);
+ if (rval != NULL && gettracingfontsstate() > 0) {
+ begindiagnostic();
+ zprintnl(' ');
+ printcstring("-> ");
+ printcstring(path);
+ zenddiagnostic(0);
+ }
}
}
}
diff --git a/Build/source/texk/web2c/xetexdir/xetex.ch b/Build/source/texk/web2c/xetexdir/xetex.ch
index 029b025333d..030a4828f3f 100644
--- a/Build/source/texk/web2c/xetexdir/xetex.ch
+++ b/Build/source/texk/web2c/xetexdir/xetex.ch
@@ -3350,6 +3350,21 @@ if translate_filename then begin
@y
file_opened:=false;
pack_file_name(nom,aire,cur_ext);
+if XeTeX_tracing_fonts_state>0 then begin
+ begin_diagnostic;
+ print_nl("Requested font """);
+ print_c_string(name_of_file+1);
+ print('"');
+ if s < 0 then begin
+ print(" scaled ");
+ print_int(-s);
+ end else begin
+ print(" at ");
+ print_scaled(s);
+ print("pt");
+ end;
+ end_diagnostic(false);
+end;
if quoted_filename then begin
{ quoted name, so try for a native font }
g:=load_native_font(u,nom,aire,s);
@@ -3376,6 +3391,24 @@ if suppress_fontnotfound_error=0 then begin
@z
@x
+done: if file_opened then b_close(tfm_file);
+@y
+done: if file_opened then b_close(tfm_file);
+if XeTeX_tracing_fonts_state>0 then begin
+ if g=null_font then begin
+ begin_diagnostic;
+ print_nl(" -> font not found, using ""nullfont""");
+ end_diagnostic(false);
+ end else if file_opened then begin
+ begin_diagnostic;
+ print_nl(" -> ");
+ print_c_string(name_of_file+1);
+ end_diagnostic(false);
+ end;
+end;
+@z
+
+@x
@d start_font_error_message==print_err("Font "); sprint_cs(u);
print_char("="); print_file_name(nom,aire,"");
@y