Problem with font mapping
Hello again, I seem to be running into all sorts of font problems. Now my document has suddenly turned bold. For example, running the following code results in "Test." being rendered in bold characters. \usemodule[simplefonts] \setmainfont[Adobe Garamond Pro] \starttext Test. \stoptext Running "mtxrun --script font --list --pattern="*Garamond*" --all" reveals that there's something fishy about the font mapping: adobegaramondpro => agaramondprosemibold => AGaramondPro-Semibold.otf adobegaramondprobold => agaramondprosemibold => AGaramondPro-Semibold.otf adobegaramondprobolditalic => agaramondprosemibolditalic => AGaramondPro-SemiboldItalic.otf adobegaramondproitalic => agaramondprobolditalic => AGaramondPro-BoldItalic.otf adobegaramondpronormal => agaramondproregular => AGaramondPro-Regular.otf adobegaramondproregular => agaramondprobold => AGaramondPro-Bold.otf adobegaramondprosemibold => agaramondprosemibold => AGaramondPro-Semibold.otf agaramondprobold => agaramondprobold => AGaramondPro-Bold.otf agaramondprobolditalic => agaramondprobolditalic => AGaramondPro-BoldItalic.otf agaramondproitalic => agaramondproitalic => AGaramondPro-Italic.otf agaramondproregular => agaramondproregular => AGaramondPro-Regular.otf agaramondprosemibold => agaramondprosemibold => AGaramondPro-Semibold.otf agaramondprosemibolditalic => agaramondprosemibolditalic => AGaramondPro-SemiboldItalic.otf As you can see, agaramond... are mapped properly while adobegaramond... are mapped wrong. Changing \setmainfont[Adobe Garamond Pro] to \setmainfont[agaramondpro] fixes the issue but, still, I'd prefer to use the former (as I've done until now) since it's clearer. I'm running ConTeXt version 2009.11.24 10:13. Mika
Mika Ritola wrote:
i cannot check it as i have no adobe garamond
As you can see, agaramond... are mapped properly while adobegaramond... are mapped wrong.
it all depends in what info is in the font ... familyname, weight etc and sometimes it's contradicting
how recent is your version of mtxrun / mtx-font / font database? it has been a bit in flux last weeks ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
2009/11/25 Hans Hagen
adobegaramondpro => Adobe Garamond Pro Bold => AGaramondPro-Bold.otf adobegaramondprobold => Adobe Garamond Pro Bold => AGaramondPro-Bold.otf adobegaramondprobolditalic => Adobe Garamond Pro Bold Italic => AGaramondPro-BoldItalic.otf adobegaramondproitalic => Adobe Garamond Pro Italic => AGaramondPro-Italic.otf adobegaramondproregular => Adobe Garamond Pro Regular => AGaramondPro-Regular.otf adobegaramondprosemibold => Adobe Garamond Pro Semibold => AGaramondPro-Semibold.otf adobegaramondprosemibolditalic => Adobe Garamond Pro Semibold Italic => AGaramondPro-SemiboldItalic.otf agaramondprobold => AGaramondPro-Bold => AGaramondPro-Bold.otf agaramondprobolditalic => AGaramondPro-BoldItalic => AGaramondPro-BoldItalic.otf agaramondproitalic => AGaramondPro-Italic => AGaramondPro-Italic.otf agaramondproregular => AGaramondPro-Regular => AGaramondPro-Regular.otf agaramondprosemibold => AGaramondPro-Semibold => AGaramondPro-Semibold.otf agaramondprosemibolditalic => AGaramondPro-SemiboldItalic => AGaramondPro-SemiboldItalic.otf In other words, the mappings seem to be fine here (though I'm not sure about the first one). Thus, it seems that some change in ConTeXt has "broken" the font.
--reload"? Updating it didn't solve the problem. Mika
Mika Ritola wrote:
the analyser has been rewritten and now let's the familyname + weight play a more important role and if there's something weird in there ... in that case the (undefined) order of hashing kicks in anyhow, i cannot check it here without fonts so someone has to buy me the adobe font collection first -) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Is this a bug in mkiv metapost? Alan minimal example: \setupcolors [state=start] \starttext \startuniqueMPgraphic{test} for i = 0 upto 10 : draw thelabel(decimal i, (i, 0) scaled 1cm) withcolor red ; % red in mkii, black in mkiv? endfor ; \stopuniqueMPgraphic \uniqueMPgraphic{test} \stoptext
Alan BRASLAU wrote:
you might try one of \chardef\MPcolormethod0 \chardef\MPcolormethod1 \chardef\MPcolormethod2 \chardef\MPcolormethod3 ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hi Alan, I run in this myself. A possible solution is: \startuniqueMPgraphic{test} for i = 0 upto 10 : draw thelabel(textext("\color[red]" & decimal i &""), (i, -1) scaled 1cm); endfor ; \stopuniqueMPgraphic \setupcolors[state=start] \starttext \uniqueMPgraphic{test} \stoptext KR Willi On Nov 27, 2009, at 10:31 AM, Alan BRASLAU wrote:
On Friday 27 November 2009 14:54:53 Willi Egger wrote:
Yes, Thanks. I thought of this as a work-around, but the first is clearly a bug. What actually works is: \setupcolors [state=start] \starttext \startuniqueMPgraphic{test} for i = 0 upto 10 : %draw thelabel(decimal i, (i, 0) scaled 1cm) withcolor red ; draw thelabel(textext("\red"& decimal i &""), (i, 0) scaled 1cm) ; endfor ; \stopuniqueMPgraphic \uniqueMPgraphic{test} \stoptext Now it is up to the experts to fix the bug in mkiv. Alan
Am 25.11.2009 um 16:27 schrieb Mika Ritola:
Hello again,
I seem to be running into all sorts of font problems. Now my document has suddenly turned bold. For example, running the following code results in "Test." being rendered in bold characters.
A few things have changed in ConTeXt font mechanism and I'm going to adapt simplefonts to the new code (will take a while) but there are now many new features available, take for example the new spec-interface which could be used to write this: \starttypescript[Xserif][all][name] \definefontsynonym [Serif] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=default] \definefontsynonym [SerifItalic] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default] \definefontsynonym [SerifSlanted] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default] \definefontsynonym [SerifBold] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-normal] [features=default] \definefontsynonym [SerifBoldItalic] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic] [features=default] \definefontsynonym [SerifBoldSlanted] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic] [features=default] \definefontsynonym [SerifCaps] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=smallcaps] \stoptypescript \starttypescript[Xsans][all][name] \definefontsynonym [Sans] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=default] \definefontsynonym [SansItalic] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default] \definefontsynonym [SansSlanted] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default] \definefontsynonym [SansBold] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-normal] [features=default] \definefontsynonym [SansBoldItalic] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic] [features=default] \definefontsynonym [SansBoldSlanted] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic] [features=default] \definefontsynonym [SansCaps] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=smallcaps] \stoptypescript \starttypescript[Xmono][all][name] \definefontsynonym [Mono] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=default] \definefontsynonym [MonoItalic] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default] \definefontsynonym [MonoSlanted] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default] \definefontsynonym [MonoBold] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-normal] [features=default] \definefontsynonym [MonoBoldItalic] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic] [features=default] \definefontsynonym [MonoBoldSlanted] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic] [features=default] \definefontsynonym [MonoCaps] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=smallcaps] \stoptypescript \starttypescript[Xserif][default][size] \definebodyfont [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt] [rm] [default] \stoptypescript \starttypescript[Xsans][default][size] \definebodyfont [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt] [ss] [default] \stoptypescript \starttypescript [Xmono][default][size] \definebodyfont [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt] [tt] [default] \stoptypescript \starttypescript[Xserif][dtp][size] \definebodyfont [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt] [rm] [default] \stoptypescript \starttypescript[Xsans][dtp][size] \definebodyfont [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt] [ss] [default] \stoptypescript \starttypescript[Xmono][dtp][size] \definebodyfont [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt] [tt] [default] \stoptypescript % this is the relevant part for the users \definetypeface[mainface][rm][Xserif][TeX Gyre Pagella][default] \definetypeface[mainface][ss][Xsans] [TeX Gyre Heros] [default][rscale=0.9] \definetypeface[mainface][tt][Xmono] [TeX Gyre Cursor] [default][rscale=1.1] \setupbodyfont[mainface] \starttext \rm\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps \ss\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps \tt\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps \stoptext Wolfgang
Wolfgang Schuster wrote:
\definefontsynonym[Serif][spec:\ctxlua{fonts.names.cleanname("\typescripttwo"}-normal-normal][features=default] I'll add \cleanfontname so that we can have \definefontsynonym[Serif][spec:\cleanfontname\typescripttwo-normal-normal][features=default] Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Wolfgang Schuster wrote:
sure, ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (6)
-
Alan BRASLAU
-
Hans Hagen
-
Mika Ritola
-
Taco Hoekwater
-
Willi Egger
-
Wolfgang Schuster