Re: [ft] Vertical Text and Rotated Characters

2013-10-18 Thread Darrell Bellert

On 10/17/2013 06:53 PM, suzuki toshiya wrote:

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().  You mention that you can accomplish rotation by glyph 
ID substitution.  How?


Thanks,

Darrell

___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Vertical Text and Rotated Characters

2013-10-18 Thread Werner LEMBERG

 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:

  Tag:
'vrt2'

  Friendly name:
Vertical Alternates and Rotation

  Registered by:
Adobe

  Function:
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.

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


  Werner

___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Vertical Text and Rotated Characters

2013-10-18 Thread Darrell Bellert

On 10/18/2013 09:27 AM, Werner LEMBERG wrote:
How did you get the impression that glyphs get rotated automatically? 
I can't find a single trace in the FreeType documentation...


The honest answer is that I'm trying to integrate FreeType into another 
application, am fairly new to the whole world of fonts, and noticed that 
characters were coming out rotated with vertical layout.  There must be 
a rotation matrix somewhere else in my application I am missing.  Chalk 
this up to newbie ignorance.  Sorry for the noise.


-Darrell

___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Vertical Text and Rotated Characters

2013-10-17 Thread suzuki toshiya
Hi,

The glyph rotation (rather, the picking the rotated glyph by the glyph
ID substitution) for the vertical writing mode is (now) classified
as a part of complex text layout for the internationalization (e.g.
Arabic, Indic, etc). Thus, now FreeType2 developers are thinking it's
a role of higher level library dealing with OpenType or TrueType GX,
like, HarfBuzz, ICU, etc.

If you have more specific interest (e.g. PostScript CID-keyed font
which can access vertical writing mode glyph without OpenType feature),
please let me know.

Regards,
mpsuzuki

On 10/18/2013 07:41 AM, Darrell Bellert wrote:
 Greetings -
 
 I am using freetype2 to render Asian characters in a vertical layout. 
 Although I am just beginning this task, I noticed that freetype seems to 
 rotate all characters by 90 degrees when rasterizing in a vertical layout.  
 Although this is desirable for latin characters, this is not what I want for 
 Asian characters.  I still want Asian characters to remain oriented upright 
 and non-rotated.
 
 Is the general assumption that it is the developer's responsibility to handle 
 such cases?  So, for Asian character ID's, I should not request vertical 
 layout of freetype - yet if I do that, how do I get vertical metrics for 
 proper layout?  Is there some missing functionality in freetype that I am 
 missing concerning the rotation of some characters in vertical layout?  Any 
 pointers or background knowledge would be helpful here and greatly 
 appreciated.
 
 Thanks,
 
 Darrell
 
 ___
 Freetype mailing list
 Freetype@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/freetype


___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype