ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Idris Samawi Hamid <ishamid@colostate.edu>
Cc: "B_Jackowski@gust.org.pl" <B_Jackowski@gust.org.pl>
Subject: Re: Re[2]: \=i
Date: Thu, 27 May 2004 13:11:41 -0600	[thread overview]
Message-ID: <opr8n99rqdu9mfh0@lamar.colostate.edu> (raw)
In-Reply-To: <1847436607.20040527123110@iol.it>

On Thu, 27 May 2004 12:31:10 +0200, Giuseppe Bilotta <gip.bilotta@iol.it> 
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

  reply	other threads:[~2004-05-27 19:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-19 23:50 \=i Idris Samawi Hamid
2004-05-21 10:28 ` \=i Hans Hagen
2004-05-21 15:58   ` \=i Idris Samawi Hamid
2004-05-24 18:42   ` \=i Idris Samawi Hamid
2004-05-26 19:33     ` \=i Idris Samawi Hamid
2004-05-27 10:31       ` Re[2]: \=i Giuseppe Bilotta
2004-05-27 19:11         ` Idris Samawi Hamid [this message]
2004-05-27 21:47         ` Hans Hagen
2004-05-29  3:24           ` Idris Samawi Hamid
2004-06-01 19:04             ` Hans Hagen
2004-06-02 19:45               ` \=i Adam Lindsay
2004-06-03 11:31                 ` \=i Hans Hagen

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=opr8n99rqdu9mfh0@lamar.colostate.edu \
    --to=ishamid@colostate.edu \
    --cc=B_Jackowski@gust.org.pl \
    --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).