[NTG-context] A problem with combining characters

luigi scarso luigi.scarso at gmail.com
Mon Jul 5 11:44:57 CEST 2010


On Fri, Jul 2, 2010 at 6:33 PM, Khaled Hosny <khaledhosny at eglug.org> wrote:
> On Fri, Jul 02, 2010 at 05:57:01PM +0200, luigi scarso wrote:
>> In this example \N{COMBINING CARON BELOW} looks bad -- a font problem ?
>>
>> \usetypescript[libertine]
>> \setupbodyfont[libertine,rm,10pt]
>> \setupinterlinespace[line=2.6ex]
>>
>> \starttext
>> %%echo '\N{LATIN SMALL LETTER A}\N{COMBINING DOT BELOW}\N{COMBINING
>> CARON BELOW}' |./uconv -t utf-8  -x "name-any
>> ạ̬
>> \stoptext
>
> Tested with Pango, the two marks overlap, very likely to be a font issue
> (no mark to mark anchor attachment). Looks good in DejaVu Sans (but not
> Serif) BTW.
Not here: the same problem of libertine.
Maybe I'm not using the right features ?

\pdfobjcompresslevel0
\pdfcompresslevel0
\unprotect


\definefontfeature[otftracker-dejavu]
    [language=dflt,mode=node,script=latn,ccmp=yes,kern=yes]

%aalt    Access All Alternates
%ccmp    Glyph Composition/Decomposition
%dlig    Discretionary Ligatures
%hlig    Historical Ligatures
%kern    Kerning
%liga    Standard Ligatures
%mark    Mark Positioning
%mkmk    Mark to Mark Positioning
%salt    Stylistic Alternates



\starttypescriptcollection[dejavu]
    \starttypescript [serif] [dejavu] [name]
        \setups[\s!font:\s!fallback:\s!serif]
        \definefontsynonym [\s!Serif]
[\s!file:DejaVuSerif.ttf]  [\s!features=otftracker-dejavu]
        \definefontsynonym [\s!SerifBold]
[\s!file:DejaVuSerif-Bold.ttf]  [\s!features=\s!default]
        \definefontsynonym [\s!SerifItalic]
[\s!file:DejaVuSerif-Italic.ttf] [\s!features=\s!default]
        \definefontsynonym [\s!SerifBoldItalic]
[\s!file:DejaVuSerif-BoldItalic.ttf] [\s!features=\s!default]
    \stoptypescript

    \starttypescript [sans] [dejavu] [name]
        \setups[\s!font:\s!fallback:\s!sans]
        \definefontsynonym [\s!Sans]
[\s!file:DejaVuSans.ttf]  [\s!features=otftracker-dejavu]
        \definefontsynonym [\s!SansBold]
[\s!file:DejaVuSans-Bold.ttf]  [\s!features=\s!default]
        \definefontsynonym [\s!SansItalic]
[\s!file:DejaVuSans-Oblique.ttf] [\s!features=\s!default]
        \definefontsynonym [\s!SansBoldItalic]
[\s!file:DejaVuSans-Oblique.ttf] [\s!features=\s!default]
    \stoptypescript
\stoptypescriptcollection
\protect


\starttypescript[dejavu]
    \definetypeface[dejavu][rm][serif][dejavu]
    \definetypeface[dejavu][ss][sans][dejavu]
\stoptypescript

\usetypescript[dejavu]
\setupbodyfont[dejavu,rm,18pt]
\setupinterlinespace[line=2.6ex]

\startluacode
function desc2utf8(desc)
  local us = ''
  local plane = 0
  for i,v in pairs(characters.data) do
   if v.description ==  desc then
     us = v.unicodeslot
     print(string.format("==> \%s u\%04x",desc,us))
     break
   end
  end
  return  tex.sprint(tex.ctxcatcodes,unicode.utf8.char(us))
end
\stopluacode
\def\N#1{\ctxlua{desc2utf8("#1")}}


\starttext
\N{LATIN SMALL LETTER A}\N{COMBINING DOT BELOW}\N{COMBINING CARON BELOW}
{\ss \N{LATIN SMALL LETTER A}\N{COMBINING DOT BELOW}\N{COMBINING CARON
BELOW} }\\
\\
{\rm \N{LATIN SMALL LETTER N}\N{COMBINING TILDE}}%
{\ss \N{LATIN SMALL LETTER N}\N{COMBINING TILDE}}\\
%
{\rm \N{LATIN SMALL LETTER N WITH TILDE}}%
{\ss \N{LATIN SMALL LETTER N WITH TILDE}}
\stoptext



-- 
luigi


More information about the ntg-context mailing list