[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] Vertical Text and Rotated Characters

From: Werner LEMBERG
Subject: Re: [ft] Vertical Text and Rotated Characters
Date: Fri, 18 Oct 2013 17:27:47 +0200 (CEST)

>> The glyph rotation (rather, the picking the rotated glyph by the
>> glyph ID substitution) for the vertical writing mode ...
> Can you expand on this?  I thought generating a rotated glyph was
> accomplished by adding the FT_LOAD_VERTICAL_LAYOUT flag to
> FT_Load_Glyph().

This is not correct.  FT_LOAD_VERTICAL_LAYOUT only makes FreeType use
the vertical metrics data, either present in the font or synthesized
by FreeType itself (the latter doesn't work consistently at the
moment).  It does *not* rotate any glyph.

How did you get the impression that glyphs get rotated automatically?
I can't find a single trace in the FreeType documentation...

> You mention that you can accomplish rotation by glyph ID
> substitution.  How?

You can't.  However, if you activate OpenType features like `vrt2' (in
case it is present in the font), you get different glyph
representation forms suitable for vertical layout.  To cite the
OpenType standard:


  Friendly name:
    Vertical Alternates and Rotation

  Registered by:

    Replaces some fixed-width (half-, third- or quarter-width) or
    proportional-width glyphs (mostly Latin or katakana) with forms
    suitable for vertical writing (that is, rotated 90 degrees
    clockwise).  Note that these are a superset of the glyphs covered
    in the vert table.

    ATM/NT 4.1 and the Windows 2000 OTF driver impose the following
    requirements for an OpenType font with CFF outlines to be used for
    vertical writing: the vrt2 feature must be present in the GSUB
    table, it must comprises a single lookup of LookupType 1 and
    LookupFlag 0, and the lookup must have a single subtable.  The
    predecessor feature, vert, is ignored.

    A rotated glyph must be designed such that its top side bearing
    and vertical advance as recorded in the Vertical Metrics ('vmtx')
    table are identical to the left side bearing and horizontal
    advance, respectively, of the corresponding upright glyph as
    recorded in the Horizontal Metrics ('hmtx') table.  (The
    horizontal advance of the rotated glyph may be set to any value,
    since the glyph is intended only for vertical writing use.  The
    vendor may however set it to head.unitsPerEm, to prevent overlap
    during font proofing tests, for example.)

    Thus, proportional-width glyphs with rotated forms in the vrt2
    feature will appear identically spaced in both vertical and
    horizontal writing.  In order for kerning to produce identical
    results as well, developers must ensure that the Vertical Kerning
    (vkrn) feature record kern values between the rotated glyphs that
    are the same as kern values between their corresponding upright
    glyphs in the Kerning (kern) feature.

    Proportional- or half-width Latin and half-width katakana
    characters are rotated 90 degrees clockwise for vertical writing.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]