Re: Re[2]: [NTG-context] \=i

2004-06-01 Thread Hans Hagen
At 05:24 29/05/2004, you wrote:
On Thu, 27 May 2004 23:47:07 +0200, Hans Hagen [EMAIL PROTECTED] wrote:
ah, we stand you sitting there crying over tex, can we?
Sometimes I want to curse TeX, believe me... Seriously though, I have a 
real phobia for all that low low-level stuff...

Did u have a chance 2 look at my general solution 4 medium fonts? I would 
like to generalize it to bold and small caps but I don't understand how to 
set up a conditionals macro that expands in accordance with the 
surrounding font. I need sthing like

\ifboldtrue
\IBARA % parameterized for bold fonts
\else
\ifsctrue
\IBARB % parameterized for sc fonts
\else
\IBAR  % parameterized for medium fonts
\fi\fi
take a look at font-ini and search for the definition of \em; but since you 
suffered already a lot:

\unprotect
\definesystemvariable{sx}
\def\definestylecollection
  {\dotripleargument\dodefinestylecollection}
\def\dodefinestylecollection[#1][#2][#3]%
  {\unexpanded\setvalue{#1}{\styleinstance[#1]}%
   \setvalue{\??sx#1:#2}{#3}}
\unexpanded\def\styleinstance[#1]%
  {\executeifdefined{\??sx#1:\fontalternative}{\getvalue{\??sx#1:\s!default}}}
\protect
\definestylecollection[mine][default][sorry]
\definestylecollection[mine][bf][\sl]
\definestylecollection[mine][sl][\tt]
{\bf test \mine test \sl test \mine test \bs oeps \mine oeps}
let me know if this works ok, maybe i can add it to the kernel then
Hans  

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re[2]: [NTG-context] \=i

2004-05-28 Thread Hans Hagen
At 12:31 27/05/2004, Giuseppe Bilotta 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)?
ah, we stand you sitting there crying over tex, can we?
in addition to gb's solution:
Very funky stuff, accents in ConTeXt. You'd have to dig up in
enco-acc plus the other enco-* files.
\=i becomes \imacron
which by default (enco-def) becomes
\definecharacter imacron  {\buildtextaccent\textmacron \dotlessi}
which you can study in enco-ini :)
you can play with:
\starttext
% \startencoding[...]
\defineaccent = {idris} {\idris}
\definecharacter idris {sirdi}
% \stopencoding
he \={idris}!
\stoptext
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: Re[2]: [NTG-context] \=i

2004-05-28 Thread Idris Samawi Hamid
On Thu, 27 May 2004 23:47:07 +0200, Hans Hagen [EMAIL PROTECTED] wrote:
ah, we stand you sitting there crying over tex, can we?
Sometimes I want to curse TeX, believe me... Seriously though, I have a 
real phobia for all that low low-level stuff...

Did u have a chance 2 look at my general solution 4 medium fonts? I would 
like to generalize it to bold and small caps but I don't understand how to 
set up a conditionals macro that expands in accordance with the 
surrounding font. I need sthing like

\ifboldtrue
\IBARA % parameterized for bold fonts
\else
\ifsctrue
\IBARB % parameterized for sc fonts
\else
\IBAR  % parameterized for medium fonts
\fi\fi
you can play with:
\starttext
% \startencoding[...]
\defineaccent = {idris} {\idris}
\definecharacter idris {sirdi}
% \stopencoding
he \={idris}!
\stoptext
I don't get it; when I run this as given I don't get any accents; I just 
get
he sirdi! Am I missing something?

Thnx 2 all
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


Re[2]: [NTG-context] \=i

2004-05-27 Thread Giuseppe Bilotta
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 becomes \imacron

which by default (enco-def) becomes

\definecharacter imacron  {\buildtextaccent\textmacron \dotlessi}

which you can study in enco-ini :)

-- 
Giuseppe Oblomov Bilotta

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: Re[2]: [NTG-context] \=i

2004-05-27 Thread Idris Samawi Hamid
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 .2em% %% 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 s 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