True Type Instructions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

True Type Instructions

siddharth-2

 


On Tue, 16 May 2006 Boris Gaertner wrote :
>
>"Noname Myname" <[hidden email]> wrote:
>
>
> > I believe that True Type Font Support in Already there in SQUEAK.
>Yes, some support for True Type Fonts is available, but it is
>still incomplete.
>
> > After seeing the Open Type specifications by microsoft and adobe ,
> > I think that to extended Support to Open Type fonts , is it just
> > nessacary to  extract the extra tables present in the Open Type
> > font ( not CFF format ).
>Right. However, the extraction of the more advanced tables
>I find the specification for the tables GSUB, GPOS and GDEF quite
>difficult to follow. For indian scripts, you will certainly need full
>support for GSUB. In the "OpenTypeViewer" that you can
>download from SqueakMap you will find incomplete support for
>the GSUB table, but the subtables for contextual substitution
>are not read - the application is still incomplete.
>
> > There was one Open Type font reader implemented, which
> > failed to work on Indian Languages ( mangal.ttf , latha.ttf
> > provided by microsoft ). Wat Xactly is the problem ?
>
> > More Over , Even if i extract all the tables how xacty
> > shud i implement the script shaping ?
> > that is wer shud i implement it ?
>For several reasons this is the hard part of the exercise:
>1. The Open Type Format is very flexible and allows for
>a considerable difference in script shaping. You may not
>assume that two different TTF fonts for, say, Devanagari,
>will contain the same or similar glyph substitution rules.
>2.  For script shaping support, you will have to rewrite
>most of the text formatting and display machinery.
>For text formatting and display the following classes
>cooperate (always with subclasses included):
>  Text, DisplayText, Paragraph, NewParagraph,
>CharacterScanner, AbstractFont, TextStyle, TextLine,
>TextLineInterval.
>
>3. I think that for script shaping you will have to implement
>a structure that maintains both a string of stored codepoints
>and a string that maintains the indices of the shaped glyphs
>to display. The mapping between these two strings is not a
>one-to-one mapping; due to script shaping several
>codepoints may merge into one display glyph, a ligature.
>
>
>  Greetings, Boris
>

One more Question , shud the true type instructions in the Open Type files definitely be executed ?

Or are they supported currently in SQUEAK ? Well if they are ... then wud'nt the display of characters be terribly slow ?

Becuz you have to create an intrepreter inside another interpreter("SQUEAK") to understand the instructions and execute them.

how does SQUEAK Handle the text display so efficiently or am i missing something very basic .... ?





Reply | Threaded
Open this post in threaded view
|

Re: True Type Instructions

Boris.Gaertner

"Noname Myname" <[hidden email]> wrote:


> One more Question , shud the true type instructions in the
> Open Type files definitely be executed ?

> Or are they supported currently in SQUEAK ?
> Well if they are ... then wud'nt
> the display of characters be terribly slow ?
Squeak does not execute glyph instructions (hints).
Most TTF fonts can be used without hinting. The well-known
exception is MingLiU, a font for chinese. The glyphs of that
font are defined as glyph instructions that assemble collections
of strokes into hanzi ideographs. To render such these glyphs,
you have to execute the glyph instructions. But I think MingLiU
is a rare exception in the universe of True Type Fonts.

> Becuz you have to create an intrepreter inside another
> interpreter("SQUEAK")
> to understand the instructions and execute them.
I think it would be doable to write an interpreter for glyph
instructions, but it would be difficult - if not impossible - to
incorporate it into an open software project like Squeak.
You have to bear in mind that some aspects of glyph hinting
are protected by patents (hold by Apple). It is therefore not
possible to freely distribute a complete implementation of
glyph hinting. There is a well-known work-around: FreeType.
The late Henrik Gedenryd has done some impressive work
in this direction, but at this moment I feel unable to explain you
details about that admireable work.

> how does SQUEAK Handle the text display so efficiently or
> am i missing something very basic .... ?
Keep in mind that you do not have to render a glyph every time
you display it. You do it once for a selected fontsize and you
render only needed glyphs. Once a glyph is rendered, it will
be cached in the font instance. This is implemented in TTCFont.
Glyph rendering itself  is implemented in
TTGlyph>>asFormWithScale:ascender:descender:fgColor:bgColor:depth:


Hope this helps.



Reply | Threaded
Open this post in threaded view
|

Re: True Type Instructions

Andrew Tween

"Boris Gaertner" <[hidden email]> wrote in message
news:000801c67921$9e28e640$fce661c2@Standard...

>
> "Noname Myname" <[hidden email]> wrote:
>
>
> > One more Question , shud the true type instructions in the
> > Open Type files definitely be executed ?
>
> > Or are they supported currently in SQUEAK ?
> > Well if they are ... then wud'nt
> > the display of characters be terribly slow ?
> Squeak does not execute glyph instructions (hints).
> Most TTF fonts can be used without hinting. The well-known
> exception is MingLiU, a font for chinese. The glyphs of that
> font are defined as glyph instructions that assemble collections
> of strokes into hanzi ideographs. To render such these glyphs,
> you have to execute the glyph instructions. But I think MingLiU
> is a rare exception in the universe of True Type Fonts.
>
> > Becuz you have to create an intrepreter inside another
> > interpreter("SQUEAK")
> > to understand the instructions and execute them.
> I think it would be doable to write an interpreter for glyph
> instructions, but it would be difficult - if not impossible - to
> incorporate it into an open software project like Squeak.
> You have to bear in mind that some aspects of glyph hinting
> are protected by patents (hold by Apple). It is therefore not
> possible to freely distribute a complete implementation of
> glyph hinting. There is a well-known work-around: FreeType.
> The late Henrik Gedenryd has done some impressive work
> in this direction, but at this moment I feel unable to explain you
> details about that admireable work.

Henrik implemented an interface to FreeType, mainly through FFI. He also
implemented sub-pixel anti-aliasing.
An alternative interface to FreeType was developed by Arjen van Elteren, and
subsequently modified by Ned Konz, (see Freetype/2 Font Demo package on
SqueakMap). This interface is built as a plugin, and has been utilised in the
Sophie project.
I am currently working on gathering some of this FreeType stuff into a form
suitable for use with, and possible inclusion in, 3.9 (or later).

FreeType is distributed, in source form, with a complete implementation of the
patent protected glyph hinting. So, following that lead, it would probably be ok
to distribute a Squeak Smalltalk implementation of the same, provided it is only
distributed as source code. The onus would be on the user of the code to ensure
that they were acting legally (e.g. by using the code in a country where the
patent does not apply, or by purchasing a license from Apple). I'm not
volunteering to write such a thing, but someone else might get a kick out of
doing it .

Cheers,
Andy

<rest snipped>




Reply | Threaded
Open this post in threaded view
|

RE: True Type Instructions

Sebastián Sastre
In reply to this post by Boris.Gaertner
Hi,

        there is any chance to run it in windows? What should be done for
that?

        best regards,

Sebastian

> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En
> nombre de Boris Gaertner
> Enviado el: Martes, 16 de Mayo de 2006 16:40
> Para: Noname Myname; The general-purpose Squeak developers list
> Asunto: Re: True Type Instructions
>
>
> "Noname Myname" <[hidden email]> wrote:
>
>
> > One more Question , shud the true type instructions in the
> Open Type
> > files definitely be executed ?
>
> > Or are they supported currently in SQUEAK ?
> > Well if they are ... then wud'nt
> > the display of characters be terribly slow ?
> Squeak does not execute glyph instructions (hints).
> Most TTF fonts can be used without hinting. The well-known
> exception is MingLiU, a font for chinese. The glyphs of that
> font are defined as glyph instructions that assemble
> collections of strokes into hanzi ideographs. To render such
> these glyphs, you have to execute the glyph instructions. But
> I think MingLiU is a rare exception in the universe of True
> Type Fonts.
>
> > Becuz you have to create an intrepreter inside another
> > interpreter("SQUEAK")
> > to understand the instructions and execute them.
> I think it would be doable to write an interpreter for glyph
> instructions, but it would be difficult - if not impossible -
> to incorporate it into an open software project like Squeak.
> You have to bear in mind that some aspects of glyph hinting
> are protected by patents (hold by Apple). It is therefore not
> possible to freely distribute a complete implementation of
> glyph hinting. There is a well-known work-around: FreeType.
> The late Henrik Gedenryd has done some impressive work in
> this direction, but at this moment I feel unable to explain
> you details about that admireable work.
>
> > how does SQUEAK Handle the text display so efficiently or
> am i missing
> > something very basic .... ?
> Keep in mind that you do not have to render a glyph every
> time you display it. You do it once for a selected fontsize
> and you render only needed glyphs. Once a glyph is rendered,
> it will be cached in the font instance. This is implemented
> in TTCFont.
> Glyph rendering itself  is implemented in
> TTGlyph>>asFormWithScale:ascender:descender:fgColor:bgColor:depth:
>
>
> Hope this helps.
>
>
>


Reply | Threaded
Open this post in threaded view
|

RE: True Type Instructions

Sebastián Sastre
In reply to this post by Andrew Tween
Dear Andy,

        how are you going with this work? Our oftalmologists will can
finally allow us to use a 3.9 image ?

        cheers,

Sebastian

> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En
> nombre de Andrew Tween
> Enviado el: Martes, 16 de Mayo de 2006 19:03
> Para: [hidden email]
> Asunto: Re: True Type Instructions
>
>
> "Boris Gaertner" <[hidden email]> wrote in message
> news:000801c67921$9e28e640$fce661c2@Standard...
> >
> > "Noname Myname" <[hidden email]> wrote:
> >
> >
> > > One more Question , shud the true type instructions in
> the Open Type
> > > files definitely be executed ?
> >
> > > Or are they supported currently in SQUEAK ?
> > > Well if they are ... then wud'nt
> > > the display of characters be terribly slow ?
> > Squeak does not execute glyph instructions (hints).
> > Most TTF fonts can be used without hinting. The well-known
> exception
> > is MingLiU, a font for chinese. The glyphs of that font are
> defined as
> > glyph instructions that assemble collections of strokes into hanzi
> > ideographs. To render such these glyphs, you have to
> execute the glyph
> > instructions. But I think MingLiU is a rare exception in
> the universe
> > of True Type Fonts.
> >
> > > Becuz you have to create an intrepreter inside another
> > > interpreter("SQUEAK")
> > > to understand the instructions and execute them.
> > I think it would be doable to write an interpreter for glyph
> > instructions, but it would be difficult - if not impossible - to
> > incorporate it into an open software project like Squeak.
> > You have to bear in mind that some aspects of glyph hinting are
> > protected by patents (hold by Apple). It is therefore not
> possible to
> > freely distribute a complete implementation of glyph
> hinting. There is
> > a well-known work-around: FreeType.
> > The late Henrik Gedenryd has done some impressive work in this
> > direction, but at this moment I feel unable to explain you details
> > about that admireable work.
>
> Henrik implemented an interface to FreeType, mainly through
> FFI. He also implemented sub-pixel anti-aliasing.
> An alternative interface to FreeType was developed by Arjen
> van Elteren, and subsequently modified by Ned Konz, (see
> Freetype/2 Font Demo package on SqueakMap). This interface is
> built as a plugin, and has been utilised in the Sophie project.
> I am currently working on gathering some of this FreeType
> stuff into a form suitable for use with, and possible
> inclusion in, 3.9 (or later).
>
> FreeType is distributed, in source form, with a complete
> implementation of the patent protected glyph hinting. So,
> following that lead, it would probably be ok to distribute a
> Squeak Smalltalk implementation of the same, provided it is
> only distributed as source code. The onus would be on the
> user of the code to ensure that they were acting legally
> (e.g. by using the code in a country where the patent does
> not apply, or by purchasing a license from Apple). I'm not
> volunteering to write such a thing, but someone else might
> get a kick out of doing it .
>
> Cheers,
> Andy
>
> <rest snipped>
>
>
>
>