[XeTeX] Newbie Question: Accessing Glyph

Fr. Michael Gilmary FrMichaelGilmary at MaroniteMonks.org
Mon Sep 13 16:31:14 CEST 2010


Marc van Dongen wrote:


> I'm trying to use an opentype "Adobe Garamond Premier Pro"
> and it works mostly fine, except that there are some problems:
>  o I'd like to know how to access certain glyphs in the font
>    files. For example, the euro symbol, the long es, and
>    ornamental symbols.
>   

Hi Marc:

We have GPP v2.0 here and you can try:

\texteuro (or enter it directly as unicode = € or \char"20AC);

ſ or \char"017F for the long es (I don't know if there's another way).

Ornaments in GPP, AFAIK, can only be accessed by using the glyph ID (347 
- 360): e.g., \XeTeXglyph347


>  o I've noticed that certain diacritics don't work such as
>    tie-after accent (\t{oo}) and bar-under accent (\b{o}).
> I'd appreciate it if somebody could provide some pointers
> which explain how to define proper commands for individual
> glyphs and how to fix the diacritics.
>   

Those two glyphs don't exist in GPP, but Junicode, for example, has them.


Diacritics can be composed using code like the following (found on this 
list before):


*********************************


From:
Juan Acevedo <juan.acevedo at gmx.net>
Date:
Mon, 25 Aug 2008 10:11:46 -0430

<snip>
In any case it is always possible to create small macros to combine 
diacritics existing in a given font. I got this jewel, or similar, some 
time ago from the list:

%% for a missing character, gratia Musa Furber and JK, XTX archives 20051102
\def\vontop#1{\leavevmode \vtop{\offinterlineskip \ialign{##\cr #1\cr
   
\setbox0=\hbox{\raise.46ex\hbox{\char"EB0A}}\ht0=0pt\dp0=0pt\hidewidth\box0
\hidewidth\cr}}}

And then modified to get some others:

%ring underneath
\def\ounder#1{\leavevmode \vtop{\offinterlineskip \ialign{##\cr #1\cr
   
\setbox0=\hbox{\raise-.1ex\hbox{{\IPA\char"02F3}}}\ht0=0pt\dp0=0pt\hidewidth\box0
\hidewidth\cr}}}


%right half ring underneath
\def\rhrunder#1{\leavevmode \vtop{\offinterlineskip \ialign{##\cr #1\cr
   
\setbox0=\hbox{\raise-.1ex\hbox{{\IPA\kern6pt\char"0339}}}\ht0=0pt\dp0=0pt\hidewidth\box0
\hidewidth\cr}}}

%put accent (or whatever) over glyph
\def\overstrike#1#2{\leavevmode
   \setbox0=\hbox{#1}\setbox1=\hbox{#2}\copy0
   \kern -0.5\wd0 \kern -0.5\wd1 \copy1 \kern -0.5\wd1 \kern 0.5\wd0}


\IPA here means simply this: \newfontfamily\IPA{Doulos SIL}. My main 
font did not have the diacritics, not even as separate characters, so I 
borrowed them from Doulos.

With \def you name your command specifying it has 1 (#1) argument. E.g. 
\vontop, \ounder...You would then say \vontop{u}, to get a u 
with...obvious, no?

I don't understand much of the rest (but don't mess with it, as it comes 
from "there where what is done is understood") except the positional 
\raise and \kern, whereby you can adjust appeareance.

You just need to know what your Unicode character is and modify the code 
after \char"

Best wishes,

Juan

***************************

HTH.






-- 
United in adoration of Jesus, 



fr. michael gilmary, mma

Most Holy Trinity Monastery
67 Dugway Road
Petersham, MA 01366-9725

www.MaroniteMonks.org






More information about the XeTeX mailing list