[NTG-context] Oddity: \buildtextaccent shifts glyph right

Rik rik at panix.com
Sun Sep 6 18:48:45 CEST 2015


On 2015-09-06 11:52, Pablo Rodriguez wrote:
> On 09/06/2015 05:27 PM, Rik wrote:
>> I am using \buildtextaccent to create a couple of characters that have
>> no Unicode equivalent.
> Hi Rik,
>
> although they don’t seem to work as expected in ConTeXt, Unicode has
> combining diacritical marks (as you might know), such as:
>
>      U+0301 COMBINING ACUTE ACCENT
>
> Just in case it might help,
>
>
> Pablo

On 2015-09-06 12:20, Thomas A. Schmitz wrote:
> \buildtextaccent has to take some heuristics about horizontal and 
> vertical placement and is sometimes wrong about it. Since your case is 
> somewhat special, I would define a macro for the que symbol and adjust 
> the boxes manually - but then, you'll have to adapt it to italic and 
> upright (and bold) and different font sizes. Depends on how important 
> typographical beauty is to you - either a medium-quality solution for 
> all cases or better quality and manual fiddling... Something like
>
> \definefontfamily [test] [serif] [ebgaramond]
>
> \setupbodyfont [test,12pt]
>
> \define\que%
>   {\bgroup
>    \setbox0\hbox{q}%
>    \setbox2\hbox to \wd0{\kern0.3em\switchtobodyfont[6pt] ʒ}%
>    \setbox4\hbox to \wd0{\kern0.1em\textacute}%
>    \hbox to \wd0 \bgroup
>      \hss\copy0\hss
>      \hskip-\wd0
>      \raise-0.45ex\copy2
>      \hskip-\wd0
>      \raise0.1ex\copy4
>     \egroup
>   \egroup\autoinsertnextspace}
>
> \starttext
>
> {\it Dicit\que mihi}
>
> \stoptext
>
> (btw, the example you sent uses Latin Modern).
>
> Thomas
>



Indeed, for the cases where there are combining accents that is a much 
better solution. I should have chosen a better example, that is, one 
that does not have a combining accent. Fortunately, there are very few 
that fall into that category, and unfortunately, there are some.

Using this, together with Thomas’s code, I can get around these issues.

Thank you both.

(And yes, I had attached the wrong example, and then referred to the 
font therein by the wrong name.)

-- 
Rik


More information about the ntg-context mailing list