ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: luigi scarso <luigi.scarso@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: A problem with combining characters
Date: Mon, 5 Jul 2010 11:44:57 +0200	[thread overview]
Message-ID: <AANLkTimWibf6VwXQFRX31PYv9Go08lHGGjoA-C-F__6o@mail.gmail.com> (raw)
In-Reply-To: <20100702163311.GA3674@khaled-laptop>

On Fri, Jul 2, 2010 at 6:33 PM, Khaled Hosny <khaledhosny@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
___________________________________________________________________________________
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
___________________________________________________________________________________

  parent reply	other threads:[~2010-07-05  9:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02 15:57 luigi scarso
2010-07-02 16:33 ` Khaled Hosny
2010-07-03  0:01   ` luigi scarso
2010-07-03  0:33     ` luigi scarso
2010-07-05  9:44   ` luigi scarso [this message]
2010-07-07  9:00     ` luigi scarso
2010-07-04 15:07 ` luigi scarso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimWibf6VwXQFRX31PYv9Go08lHGGjoA-C-F__6o@mail.gmail.com \
    --to=luigi.scarso@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).