Many thanks, ZdenÄk. For the benefit of both posterity and
non-CZ speakers, I append Google's translation of your article :
** Phil.
--------
Print outline of the font in PDF
Zdenek Wagner
The article shows the possibility of rendering the contour
of the font by direct use of the operator
PDF. It explains how to use the family of drivers (x) dvipdfm (x)
also in pdfTEX. Possible complications are mentioned and the case can not be
stated
use the method.
Keywords
PDF, font contours, font fill, initials, Open Type, Type 1
1. Introduction
Prints of some type, especially advertising, but also
fiction, occasionally require it
parts of the text were highlighted in a less usual
way. An example of such
the highlight is the initials at the beginning of
this paragraph. It is not printed with a special font,
it is a TEX Gyre Adventor wild-type font. The difference lies in the fact,
that we did not print the character in the usual way, but we
let the PDF show the outline,
which we
filled in a different color. This is enabled by fonts in formats
Type 1 and OpenType define characters using the outline that
are in normal print
filled in by the
selected color. We just used another way of rendering, which
we will describe in detail below.
2. Display the font contour in PDF
When viewing the contour of the font, we will use the
special command to
output
directly to PDF operators. As with PostScript, there are parameters
before the name of the operator.
In the PDF documentation [1] we find Tr operator, whose
description is not very comprehensible.
And this operator determines how the font is displayed.
The usual value of 0 causes a classic fill as you see it
virtually in
of all texts. Setting a value of 1 will show the outline without fill,
value 2
allows the contour to be displayed in one
color and the fill in another. Set the line thickness
operator w, with the unit being a big point. Set the color either
operator g and G (gray, the operator has one parameter), or
rg and RG (color
RGB space, three parameters), or k and K (CMYK color space,
four parameters).
Operators written in small letters set the fill color,
operators
in
capital letters, determine the color of the line. The initiator has the
opening paragraph
setting 2 Tr .8 w 0 .1 1 .1 k .8 1 0 0 K. Before this
setting
the graphical state is stored by the operator q, and
after printing the initials, the graphical state is
restored
operator Q. Everything looks very simple. So let us explain how it is mentioned
we will get the commands to PDF.
2.1. Contour view in driver (x) dvipdfm (x)
We start with the simpler case of the driver family (x)
dvipdfm (x) [2].
The
effect can also be used in X ETEX. The following demonstration
We will print out a few words in outline.
we created it with a command
{\ centering \ Large \ fontfamily {qag} \ bfseries
Several \ special {pdf: code q 2 Tr 0.7 w 0 .5 .5 .05 k
1 1 0 .1 K}
words \ special {pdf: code 0 0 1 0 k 1 0 1 .1 K}
we will print \ special {pdf: code Q} in outline. \ par}
In older versions of driver (x), dvipdfm (x) is not
available in the \ special command
the code function, but only the put, but which inserts
the content between q and Q, that is
the desired
effect is lost. It can be remedied by a simple trick, when these
automatically
Inserted operators are eliminated by a paired
operator. In that case
instead of \ special {pdf: code q 2 Tr}, we will write
the modified code with the added operators
\
special {pdf: Put Q q 2 Tr q}. The command \ special {pdf: put Q} none
does not need modification.
2.2. Outline view in pdfTEX
Inspired by the previous example, we write the code
mechanically using the primitive
\ pdfliteral [3] as follows:
{\ centering \ Large \ fontfamily {qag} \ bfseries
One \ pdfliteral {q 2 Tr 0.7 w 0 0 1 0 k ~ 1 0 1 .1 K}
word \ pdfliteral {Q} different. \ par}
However,
the result does not meet our expectations. The word will be otherwise overwritten
and, in addition, the rate of the remainder of
the article is significantly declining. For this reason, here is a sample
it is not, try it yourself.
Where they went
wrong? The difference lies in the fact that pdfTEX is re-set
current transformation matrix, but saving and restoring
the graphical state of this
we will destroy the
effort. We therefore have to tell pdfTEX to temporarily leave
this setup
dropped, which is achieved by
inserting the page key. Here is the working code:
{\ centering \ Large \ fontfamily {qag} \ bfseries
One \ pdfliteral page {q 2 Tr 0.7 w 0 0 1 0 k 1 0 1
.1 K}
the word \ pdfliteral page {Q} otherwise. \ par}
3. When can not use the contour font?
The method described assumes that the font used is
OpenType or
Type 1. Even then, it can
happen that this procedure can not be used. This happens,
when the characters in the script merge, as in the
Arabic and Indian scripts
derived
from the brahmi. In the picture, which contains a request to the
Muslim
in Hindi and Urdu, it is clear that the way in which
character, not the outline of the resulting text.
à¤à¤¦ मà¥à¤¬à¤¾à¤°à¤ رک ô¯ôôôô¾ôô ع
Reference
[1] PDF Reference, 6th edition: Adobe Portable
Document Format version 1.7.
Adobe Systems Incorporated, November 2006.
[2] Wicks, Mark A. Dvipdfm User's Manual. Version 0.12.4b. September 19,
1999.
[3] Thà nh, Hà n
Th'ê; Rahtz,
Sebastian; Hagen,
Hans; Henkel, Hartmut;
Jackowski, PaweÅ;
Schröder, Martin.
The pdfTEX
user manual. Roar. 655.
November 23, 2010.
Summary: Printing the outline font in PDF
The article presents the possibility of printing
the script outline by direct use
of PDF
operators. Method of use in the (x) dvipdfm (m) drivers
family as well
as
in pdfTEX is explained. Possible complications are mentioned and an
example
is shown where the method is inapplicable.
Key words
PDF, outline and fill font, inline letters, Open
Type, Type 1
Zdenek Wagner
Ice Bear Soft
http://icebearsoft.euweb.cz