Script to move each glyph

View: New views
5 Messages — Rating Filter:   Alert me  

Script to move each glyph

by croy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I want to move any glyph in a font to align lowest point in each glyph on y=0 coordinate.

Is it possible by existing menus dialog ?

Is it possible by script ?

Thanks in advance for any help.

PS : the target font is a hieroglyphic font with several thousands of glyphs.

Parent Message unknown Re: Script to move each glyph

by croy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your very fast reply.

Where is located documentation for this boundingBox function ?

Regards.

Where
Le 8 oct. 2009 à 09:03, Barry Schwartz a écrit :

>
> croy <christian.roy@...> skribis:
>> I want to move any glyph in a font to align lowest point in each  
>> glyph on
>> y=0 coordinate.
>>
>> Is it possible by existing menus dialog ?
>>
>> Is it possible by script ?
>
> In Python scripting you can use the boundingBox() methods to find the
> glyph's descent and then translate the glyph upwards by that amount.
>




------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Fontforge-users mailing list
Fontforge-users@...
https://lists.sourceforge.net/lists/listinfo/fontforge-users

Re: Script to move each glyph

by Barry Schwartz-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christian Roy <christian.roy@...> skribis:
> Where is located documentation for this boundingBox function ?

http://fontforge.sourceforge.net/python.html


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Fontforge-users mailing list
Fontforge-users@...
https://lists.sourceforge.net/lists/listinfo/fontforge-users

Fwd: Script to move each glyph

by croy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Please find below the script corresponding to my need :

import fontforge;
import psMat;

fontforge.open( "Bernhardt-EGPZB11.ttf" );
font = fontforge.activeFont()
font.selection.all( );
for glyph in font.selection.byGlyphs:
bbox = glyph.boundingBox( );
if bbox[1] < 0 :
mat = psMat.translate( 0,-bbox[1] );
glyph.transform( mat );
font.generate( "Bernhardt-EGPZB11.ttf" );

Thanks for your help.

Début du message réexpédié :

De : Christian Roy <christian.roy@...>
Date : 8 octobre 2009 10:38:55 HAEC
Cc : Barry Schwartz <chemoelectric@...>
Objet : Rép : [Fontforge-users] Script to move each glyph

Thanks for your very fast reply.

Where is located documentation for this boundingBox function ?

Regards.

Where
Le 8 oct. 2009 à 09:03, Barry Schwartz a écrit :


croy <christian.roy@...> skribis:
I want to move any glyph in a font to align lowest point in each glyph on
y=0 coordinate.

Is it possible by existing menus dialog ?

Is it possible by script ?

In Python scripting you can use the boundingBox() methods to find the
glyph's descent and then translate the glyph upwards by that amount.




------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Fontforge-users mailing list
Fontforge-users@...
https://lists.sourceforge.net/lists/listinfo/fontforge-users

Re: Fwd: Script to move each glyph

by Khaled Hosny-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Oct 08, 2009 at 01:49:04PM +0200, Christian Roy wrote:
> Please find below the script corresponding to my need :
>
> import fontforge;
> import psMat;
>
> fontforge.open( "Bernhardt-EGPZB11.ttf" );
> font = fontforge.activeFont()
> font.selection.all( );
> for glyph in font.selection.byGlyphs:

The last two lines can be shortened to:
for glyph in font.glyphs():

Regards,
 Khaled

--
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Fontforge-users mailing list
Fontforge-users@...
https://lists.sourceforge.net/lists/listinfo/fontforge-users

signature.asc (204 bytes) Download Attachment