<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Thank you Ross and others. <br>
In fact, \kok is what I need. I need it to implement the Kashida option
in xepersian that I will post my implementation this week in a separate
email. <br>
Mehdi<br>
On 4/11/2010 2:23 AM, Ross Moore wrote:
<blockquote
cite="mid:CAB14693-C176-45FB-BD7E-760C1585CA7C@maths.mq.edu.au"
type="cite"><br>
On 11/04/2010, at 3:56 AM, Mehdi Omidali wrote:
<br>
<br>
<blockquote type="cite">Hi all,
<br>
Is it possible to construct a box that contains a fraction (say half)
of a character (horizontal half) of a font.
<br>
</blockquote>
<br>
<br>
It isn't clear whether you want the width of the box
<br>
to be the original character width, or only the width
<br>
of what remains visible after knocking-out half of it.
<br>
<br>
Here are commands which implement both viewpoints,
<br>
with an optional parameter to adjust how much to
<br>
"knock out" (i.e., overprint with a white rule).
<br>
The examples test various amounts.
<br>
<br>
\usepackage{color}
<br>
<br>
\newcommand{\ko}[2][.25]{{#2%
<br>
\setbox0=\hbox{#2}\dimen0=#1\wd0
<br>
\dimen2=\ifdim \dp0=0pt .1ex\else 1.1\dp0\fi
<br>
\kern-\dimen0
<br>
{\color{white}\vrule height 1.1\ht0 depth\dimen2 width\dimen0}%
<br>
% \kern-\dimen0
<br>
}}
<br>
<br>
\newcommand{\kok}[2][.25]{{#2%
<br>
\setbox0=\hbox{#2}\dimen0=#1\wd0
<br>
\dimen2=\ifdim \dp0=0pt .1ex\else 1.1\dp0\fi
<br>
\kern-\dimen0
<br>
{\color{white}\vrule height 1.1\ht0 depth\dimen2 width\dimen0}%
<br>
\kern-\dimen0
<br>
}}
<br>
<br>
\begin{document}
<br>
\noindent Retain full character widths:\par
<br>
\medskip
<br>
{\LARGE\noindent
<br>
\ko{H}\ko{E}\ko{L}\ko{L}\ko{O} \ko{W}\ko{o}\ko{r}\ko{l}\ko{d}.\par}
<br>
{\LARGE\noindent
<br>
\ko[.5]{H}\ko[.5]{E}\ko[.5]{L}\ko[.5]{L}\ko[.5]{O}
\ko[.3]{W}\ko[.3]{o}\ko[.3]{r}\ko[.3]{l}\ko[.3]{d}.\par}
<br>
<br>
\bigskip
<br>
\noindent Use only the width remaining after knock-out:\par
<br>
\medskip
<br>
{\LARGE\noindent
<br>
\kok{H}\kok{E}\kok{L}\kok{L}\kok{O}
\kok{W}\kok{o}\kok{r}\kok{l}\kok{d}.\par}
<br>
{\LARGE\noindent
<br>
\kok[.5]{H}\kok[.5]{E}\kok[.5]{L}\kok[.5]{L}\kok[.5]{O}
\kok[.3]{W}\kok[.3]{o}\kok[.3]{r}\kok[.3]{l}\kok[.3]{d}.\par}
<br>
<br>
<br>
<br>
<br>
<blockquote type="cite">Mehdi
<br>
<br>
<br>
--------------------------------------------------
<br>
Subscriptions, Archive, and List information, etc.:
<br>
<a class="moz-txt-link-freetext" href="http://tug.org/mailman/listinfo/xetex">http://tug.org/mailman/listinfo/xetex</a>
<br>
</blockquote>
<br>
------------------------------------------------------------------------
<br>
Ross Moore <a class="moz-txt-link-abbreviated" href="mailto:ross@maths.mq.edu.au">ross@maths.mq.edu.au</a>
<br>
Mathematics Department office: E7A-419
<br>
Macquarie University tel: +61 (0)2 9850
8955
<br>
Sydney, Australia 2109 fax: +61 (0)2 9850
8114
<br>
------------------------------------------------------------------------
<br>
<br>
<br>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
<a class="moz-txt-link-freetext" href="http://tug.org/mailman/listinfo/xetex">http://tug.org/mailman/listinfo/xetex</a>
</pre>
</blockquote>
<br>
</body>
</html>