On Thu, 27 May 2004 12:31:10 +0200, Giuseppe Bilotta <[EMAIL PROTECTED]> wrote:

Wednesday, May 26, 2004 Idris Samawi Hamid wrote:

Could not interest anyone in the \=i problem, I guess. Anyway, could
someone tell me how ConTeXt defines \=i (so as to always get plain \=\i)?

Very funky stuff, accents in ConTeXt. You'd have to dig up in enco-acc plus the other enco-* files.

I actually found this last night, digging in the ConTeXt code. U're right: VERY funky stuff;-)
But it's really nice, since, thnx 2 the way Hans has abstracted things, the solution for \=i has no effect on \=I or anything else:-)
Anyway, I now have a working proper accent now for \tf and \it;


=============imacron.tex==================
\setupoutput[pdftex]

\setupbodyfontenvironment[default][em=italic]

\def\SHIFT#1{\dimen0=.00#1ex \multiply\dimen0 by\fontdimen1\font
    \kern-.0156\dimen0} % compensate for slant/italic in lower accents

\def\USHIFT#1{\dimen0=.00#1ex \multiply\dimen0 by\fontdimen1\font
\kern.0156\dimen0} % compensate for slant/italic in upper accents


\def\IBAR%
{\leavevmode\vbox{\offinterlineskip\lineskip0.295ex%
%\ialign{##\cr\USHIFT{120}\hbox to .27777em% %% for width of i-box
%{\leaders\hrule height .067354ex\hfill}%
%\SHIFT{1}\cr\i\cr}}}
\ialign{##\cr\USHIFT{120}\hfill\hbox to .21243em% %% for width of i-glyph base
{\leaders\hrule height .067354ex\hfill}%
\hfill\SHIFT{1}\cr\i\cr}}}


\starttext

\definecharacter imacron %
{\buildtextaccent\textmacron \dotlessi}
% original def from enco-def.tex

\=i \=I

{\em b\=in\=ary} f\=i\high{\txx c}\=i % {\bi b\=in\=ary} % need conditionals for bold and small caps

\blank[big]

\definecharacter imacron {\IBAR}
% new imacron

\=i \=I

{\em b\=in\=ary}   f\=i\high{\txx c}\=i % {\bi  b\=in\=ary}

\stoptext
==================================================================

A word on the parameters: I ran tftopl on cmr12.tfm, made a note of the QUAD and X-HEIGHT values, as well as the width of the i-box. I opened \cmr12.pfb in FontLab and made some measurements of the i-glyph and the macron bar; dividing a given width by the QUAD-value gives the rlative em values used above (similarly for the lineskip calculation, dividing heights by X-HEIGHT).

The definition of \IBAR has two possibilities: macron is width of the i-box, or it's the width of the base of the i-glyph. Upon experimentation, I found the latter width more aesthetically pleasing, but I have kept the other as an option (commented). In fact, making the macron the width of the i-box may make better sense for \sc.

PROBLEM: Now I need to learn more about \TeX conditionals, because this solution does not work for \bf, \bi, and the like. The height of the imacron bar needs to be greater for bold fonts. How can I make a set of three conditionals such that the definition of \IBAR has a different expansion for

\tf, \it, \sl etc.

\bf, \bi, \bs etc.

\sc

??? That is, when \bf is on, the definition of \IBAR should expand a conditional that is based on the bold-dependent parameters.

Anyway, for \tf and \it this looks soooo much better than the plain.tex imacron; Please try it out! And I'm open to suggestions on tweaking the parameters to make this look better.

Best
Idris

--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to