[NTG-context] Mixing math and text font
Dear list, in my math, I would like one font (the text font) to be used for letters and digits and another font (the math font) to be used for mathematical symbols. I have tried it like that: % Example 1 \usemodule[simplefonts][size=40pt] \setmathfont[termes] \setmainfont[latinmodernroman] \starttext 123\\$ 123 \coprod \leftrightarrow $ \stoptext % Example 2 \definetypeface [fonttest] [rm][serif] [modern] \definetypeface [fonttest] [mm][math] [termes] \setupbodyfont[fonttest, 40pt] \starttext 123\\$ 123 \coprod \leftrightarrow $ \stoptext In both examples, the math font is used for the whole formula. How can I mix the fonts? Kind regards and best wishes for 2014, Joshua Krämer ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Mixing math and text font
Am 04.01.2014 um 16:04 schrieb Joshua Krämer joshua.krae...@gmail.com: Dear list, in my math, I would like one font (the text font) to be used for letters and digits and another font (the math font) to be used for mathematical symbols. I have tried it like that: % Example 1 \usemodule[simplefonts][size=40pt] \setmathfont[termes] \setmainfont[latinmodernroman] \starttext 123\\$ 123 \coprod \leftrightarrow $ \stoptext % Example 2 \definetypeface [fonttest] [rm][serif] [modern] \definetypeface [fonttest] [mm][math] [termes] \setupbodyfont[fonttest, 40pt] \starttext 123\\$ 123 \coprod \leftrightarrow $ \stoptext In both examples, the math font is used for the whole formula. How can I mix the fonts? This is possible but you have to use the context suite [1] and not texlive or miktex because the context version they provide doesn’t include the necessary mechanism. [1] http://wiki.contextgarden.net/ConTeXt_Standalone Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Mixing math and text font
Am Sat, 04 Jan 2014 17:44:22 +0100 schrieb Wolfgang Schuster: This is possible but you have to use the context suite [1] and not texlive or miktex because the context version they provide doesn’t include the necessary mechanism. [1] http://wiki.contextgarden.net/ConTeXt_Standalone Wolfgang Thanks for your answer. I already use context standalone, but even after an update (first-setup.sh), the fonts are not mixed. What are the additional steps to do? Kind regards, Joshua Krämer ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Mixing math and text font
On Sat, 4 Jan 2014, Joshua Krämer wrote: Dear list, in my math, I would like one font (the text font) to be used for letters and digits and another font (the math font) to be used for mathematical symbols. I have tried it like that: % Example 1 \usemodule[simplefonts][size=40pt] \setmathfont[termes] \setmainfont[latinmodernroman] \starttext 123\\$ 123 \coprod \leftrightarrow $ \stoptext % Example 2 \definetypeface [fonttest] [rm][serif] [modern] \definetypeface [fonttest] [mm][math] [termes] \setupbodyfont[fonttest, 40pt] \starttext 123\\$ 123 \coprod \leftrightarrow $ \stoptext In both examples, the math font is used for the whole formula. How can I mix the fonts? You ask for modern as the text font and termes as the math font, and that is what you get. Can you elaborate what do you mean by 'mix the fonts'? What output do you want to get. Aditya___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Mixing math and text font
Am Sat, 04 Jan 2014 12:47:24 -0500 schrieb Aditya Mahajan: You ask for modern as the text font and termes as the math font, and that is what you get. Can you elaborate what do you mean by 'mix the fonts'? What output do you want to get. For the text font I use (it's a commercial typeface), a matching math font doesn't exist. Now if I use for example Termes as the math font, the formulae don't match the regular text, because the letters and digits differ. That's why I want in the formulae math symbols like special arrows and operators to be taken from Termes, but regular alphanumeric characters from my text font. So in my minimal examples, 123 should look the same in the text and the formula. Kind regards, Joshua Krämer ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Mixing math and text font
Am 04.01.2014 um 18:22 schrieb Joshua Krämer joshua.krae...@gmail.com: Am Sat, 04 Jan 2014 17:44:22 +0100 schrieb Wolfgang Schuster: This is possible but you have to use the context suite [1] and not texlive or miktex because the context version they provide doesn’t include the necessary mechanism. [1] http://wiki.contextgarden.net/ConTeXt_Standalone Wolfgang Thanks for your answer. I already use context standalone, but even after an update (first-setup.sh), the fonts are not mixed. What are the additional steps to do? You have to switch from the simplefonts module to the new fontfamily command (a new built-in system which replaces simplefonts) to set the fonts for your document. The fourth argument specifies which part of the font you want to replace (you could also have written [preset=math:lowercaseitalic] instead of [math:lowercaseitalic]). \definefontfamily [mainface] [rm] [Latin Modern Roman] \definefallbackfamily [mainface] [mm] [Latin Modern Roman] [math:lowercaseitalic] \definefontfamily [mainface] [mm] [TeX Gyre Termes Math] \setupbodyfont[mainface] \starttext TeX uses different fonts for text and math, e.g. \math{f(x)=x^2+2x+4} but it possible to replace certain characters in the math font with glyphs from a text font. \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Malayalam shaping with mkiv/LuaTeX
Hello, especially Hans and Kai, I have succeeded to an extent in adding Malayalam shaping to the existing Devanagari shaping. Being a complete novice in Lua and mkiv, I'm at a point where your expertise is needed to proceed further. Please find the attached patch, test case listed below and expected rendering for comparison. Additionally needed to support: 1. Decomposing 2 part Matras (dependent vowels) - 0D4A, 0D4B, 0D4C for Malayalam [Test cases 2 4]. This is needed (at least) for Tamil also. I guess it is as simple as replacing one code point with 2 others - example: replace 0D4A with 0D46, 0D3E. See page 3 of this Unicode standard: http://www.unicode.org/charts/PDF/U0D00.pdf 2. Handling pref opentype feature for v2 opentype spec (script tag mlm2). This is required for Malayalam Ra ligature, the glyph is formed correctly but it needs to be reordered as pre-base to the base syllable [Test case 1]. (Note that the old spec mlym handles Ra form as pstf and no reordering required). You can observe the difference in Test case 5 - Ra form should be attached to first consonant instead of second one (mlm2 needs glyph formed by Virama+Ra to be reordered as pre-base to first consonant, while mlym doesn't need to). 3. Handling pstf opentype feature. It works mostly [Test case 8], except when a post-base Matra follows [Test case 9]. 4. Test cases 6 7 shows an example where glyph formation fails when a pstf Ya follows. This works correctly with some other conjuncts, though. 4. font-odv.lua hard coded Devanagari Virama (094D) and Ra (0930) in certain places, which needs to use table values to handle other scripts. 5. I had to change methods.deva to methods.mlym and methods.dev2 to methods.mlm2 to get this working, not sure how best to handle multiple scripts. 6. There are other cases like Dot-reph (0D4E) which uses GPOS table and requires reordering as post-base to the syllable follows it, but I haven't looked into them yet. i) The font used is Rachana, which supports both mlm2 and mlym specs, can be downloaded from here: http://download.savannah.gnu.org/releases/smc/fonts/malayalam-fonts-6.0/Rachana/Rachana.ttf You can switch to mlm2 and mlym in test case. ii) Expected rendering of this test case: http://rajeeshknambiar.fedorapeople.org/ConTeXt/context-test.png iii) Test case: --- 8 - \usemodule[font-odv] \definefontfeature[malayalam][mode=node,language=dflt,script=mlm2,akhn=yes,blwf=yes,half=yes,pres=yes,blws=yes,psts=yes,haln=no] %\definefontfeature[malayalam][mode=node,language=dflt,script=mlym,akhn=yes,blwf=yes,half=yes,pres=yes,blws=yes,psts=yes,haln=no] \starttypescript [serif] [rachana] [name] \definefontsynonym[Serif] [file:rachana][features={malayalam}] \stoptypescript \starttypescript [rachana] \definetypeface[rachana][rm][serif][rachana][default] \definetypeface[rachana][mm][math] [modern][default] \stoptypescript \setupbodyfont[rachana] \starttext 1. \char0D15 \char0D4D \char0D24 \char0D4D \char0D30 \\ % ക്ത്ര 2. \char0D15 \char0D4D \char0D24 \char0D4D \char0D30 \char0D4B \\ % ക്ത്രോ 3. \char0D38 \char0D4D \char0D2A \char0D4D \char0D30 \\ % സ്പ്ര 4. \char0D38 \char0D4D \char0D2A \char0D4D \char0D30 \char0D4C \\ % സ്പ്രൌ 5. \char0D24 \char0D4D \char0D30 \char0D2A \\ % ത്രപ 6. \char0D24 \char0D4D \char0D38 \\ % ത്സ 7. \char0D24 \char0D4D \char0D38 \char0D4D \char0D2F \\ % ത്സ്യ 8. \char0D15 \char0D4D \char0D2F \\ % ക്യ 9. \char0D15 \char0D4D \char0D2F \char0D42 \\ % ക്യൂ \stoptext --- 8 - Let me know if you need additional information or clarifications on test cases. [Patch, test case, expected output image etc are also available here: http://rajeeshknambiar.fedorapeople.org/ConTeXt/] -- Cheers, Rajeesh http://rajeeshknambiar.wordpress.com --- tex/texmf-context/tex/context/base/font-odv.lua 2013-10-01 12:53:06.0 +0200 +++ tex/texmf-context/tex/context/base/font-oin.lua 2014-01-04 19:38:52.874015300 +0100 @@ -1,7 +1,7 @@ -if not modules then modules = { } end modules ['font-odv'] = { +if not modules then modules = { } end modules ['font-odv'] = { version = 1.001, -comment = companion to font-ini.mkiv, -author= Kai Eigner, TAT Zetwerk / Hans Hagen, PRAGMA ADE, +comment = Indic shaping companion to font-ini.mkiv, +author= Kai Eigner, TAT Zetwerk / Hans Hagen, PRAGMA ADE / Rajeesh K Nambiar, copyright = TAT Zetwerk / PRAGMA ADE / ConTeXt Development Team, license = see context related readme files } @@ -182,6 +182,17 @@ local consonant = { [0x0CB5] = true, [0x0CB6] = true, [0x0CB7] = true, [0x0CB8] = true, [0x0CB9] = true, [0x0CDE] = true, -- obsolete +-- malayalam +[0x0D15] = true, [0x0D16] = true, [0x0D17] = true, [0x0D18] = true, +[0x0D19] = true, [0x0D1A] = true, [0x0D1B] = true, [0x0D1C] = true, +[0x0D1D] = true, [0x0D1E] = true, [0x0D1F] = true, [0x0D20] = true, +[0x0D21] = true, [0x0D22] = true, [0x0D23] = true, [0x0D24] = true, +
Re: [NTG-context] unknown library 'loc'
On 1/3/2014 2:33 PM, H. van der Meer wrote: Has someone an idee what causes the unknown library message as in the log below? Is it harmful? fontstypescripts unknown library 'loc' (/Users/hansm/tex/context-16/tex/texmf-context/tex/context/base/type-imp-texgyre.mkiv){/Users/hansm/tex/context-16/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/Users/hansm/tex/context-16/tex/texmf/fonts/map/dvips/lm/lm-rm.map}{/Users/hansm/tex/context-16/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}) it's a harmless side effect that i need to figure out when i have time Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___