[fontforge-users] I cannot find some functions a Python scripting.

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[fontforge-users] I cannot find some functions a Python scripting.

michinari.nukazawa
Hello.
Please help.

I porting my font build script to Python, from .pe format.
( https://github.com/MichinariNukazawa/RuneAMN_Pro_Series_Fonts/blob/gh-pages/font_generate.pe )

But I cannot find some functions from a document.


1. Set Baseline (before or after Imported SVG files).

    # Select(0u0020, 0u007e)
    # ScaleToEm((1000 - _baseline), _baseline)

2. Points location chop rounded.

    # RoundToInt()


3. Set Ascent/Descent

    # ディセント(フォント下端)
    # SetOS2Value("WinDescentIsOffset"  , 0)
    # SetOS2Value("HHeadDescentIsOffset", 0)
    # SetOS2Value("WinDescent"  , 0)
    # SetOS2Value("HHeadDescent", 0)
    # アセント(フォント高さ)
    # SetOS2Value("WinAscentIsOffset", 0)
    # SetOS2Value("HHeadAscentIsOffset" , 0)
    # SetOS2Value("WinAscent", 1000)
    # SetOS2Value("HHeadAscent" , 1000)

 I find function is:
     font.os2_windescent = 0
     font.os2_winascent = 1000
 want other OS2 field-names.



Thanks.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|

Re: I cannot find some functions a Python scripting.

Michel Boyer
Hi

The names given to those values varies too much to my taste between applications.
Before you get an answer from someone that took the time to read the source code (or some proper documentation), you can compare with the values given by the following script

Michel


for i in ["em", 
"ascent", 
"descent", 
"hhea_ascent", 
"hhea_descent", 
"hhea_linegap",
"os2_typoascent", 
"os2_typodescent", 
"os2_typolinegap",
"os2_winascent", 
"os2_windescent", 
"hhea_ascent_add", 
"hhea_descent_add", 
"os2_typoascent_add", 
"os2_typodescent_add",
"os2_winascent_add", 
"os2_windescent_add"]:
  print "%-25s %6s" % (i+":", eval("fnt."+i))

On Feb 7, 2015, at 4:38 AM, michinari.nukazawa <[hidden email]> wrote:

Hello.
Please help.

I porting my font build script to Python, from .pe format.
( https://github.com/MichinariNukazawa/RuneAMN_Pro_Series_Fonts/blob/gh-pages/font_generate.pe )

But I cannot find some functions from a document.


1. Set Baseline (before or after Imported SVG files).

    # Select(0u0020, 0u007e)
    # ScaleToEm((1000 - _baseline), _baseline)

2. Points location chop rounded.

    # RoundToInt()


3. Set Ascent/Descent

    # ディセント(フォント下端)
    # SetOS2Value("WinDescentIsOffset"  , 0)
    # SetOS2Value("HHeadDescentIsOffset", 0)
    # SetOS2Value("WinDescent"  , 0)
    # SetOS2Value("HHeadDescent", 0)
    # アセント(フォント高さ)
    # SetOS2Value("WinAscentIsOffset", 0)
    # SetOS2Value("HHeadAscentIsOffset" , 0)
    # SetOS2Value("WinAscent", 1000)
    # SetOS2Value("HHeadAscent" , 1000)

 I find function is:
     font.os2_windescent = 0
     font.os2_winascent = 1000
 want other OS2 field-names.



Thanks.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|

[fontforge-users] width of space changes in 'monospace font.

Ray Andrews
Gentlemen,

I hope this isn't a double, I sent previously but it seems to have not
made it to the list.

My first effort with fontforge:  I copied a monospace .ttf font to
another name, changed the identification strings and saved it without
making any other changes.  The 'new' font shows up as being available,
and I can select it and use it, however in my code editor (geany) when
the font is bolded (that is when it is *not* showing commented code) the
width of the space is about 1/12 too narrow, so the font no longer is
truly monospace:

#1234567890 this line is truly monospace
#                   0 this line is truly monospace
01234567890 this line is truely monospace
0                    0 this line is NOT monospace, the spaces are narrower.

How can I repair that?


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|

Re: width of space changes in 'monospace font.

Frank Trampe
Did you make a bold version of the new typeface, or is the editor automatically generating a bold face?

On Saturday, February 7, 2015, Ray Andrews <[hidden email]> wrote:

> Gentlemen,
>
> I hope this isn't a double, I sent previously but it seems to have not
> made it to the list.
>
> My first effort with fontforge:  I copied a monospace .ttf font to
> another name, changed the identification strings and saved it without
> making any other changes.  The 'new' font shows up as being available,
> and I can select it and use it, however in my code editor (geany) when
> the font is bolded (that is when it is *not* showing commented code) the
> width of the space is about 1/12 too narrow, so the font no longer is
> truly monospace:
>
> #1234567890 this line is truly monospace
> #                   0 this line is truly monospace
> 01234567890 this line is truely monospace
> 0                    0 this line is NOT monospace, the spaces are narrower.
>
> How can I repair that?
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> fontforge-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/fontforge-users
> http://fontforge.10959.n7.nabble.com/User-f8781.html
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|

Re: width of space changes in 'monospace font.

Ray Andrews
On 02/07/2015 08:42 AM, Frank Trampe wrote:
Did you make a bold version of the new typeface, or is the editor automatically generating a bold face?

Automatic I think, whatever 'automatic' means! 

This is the font I copied:

DejaVuSansMono.ttf

And there is this one too:

DejaVuSansMono-Bold.ttf

... but I never touched it.  When I select my 'Test.ttf' font, it doesn't complain that a bold version is missing, or anything, it looks identical in every way except for the slightly narrower space.  Should I try copying the 'Bold' font too?
==========


On Saturday, February 7, 2015, Ray Andrews <[hidden email]> wrote:
> Gentlemen,
>
> I hope this isn't a double, I sent previously but it seems to have not
> made it to the list.
>
> My first effort with fontforge:  I copied a monospace .ttf font to
> another name, changed the identification strings and saved it without
> making any other changes.  The 'new' font shows up as being available,
> and I can select it and use it, however in my code editor (geany) when
> the font is bolded (that is when it is *not* showing commented code) the
> width of the space is about 1/12 too narrow, so the font no longer is
> truly monospace:
>
> #1234567890 this line is truly monospace
> #                   0 this line is truly monospace
> 01234567890 this line is truely monospace
> 0                    0 this line is NOT monospace, the spaces are narrower.
>
> How can I repair that?
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> fontforge-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/fontforge-users
> http://fontforge.10959.n7.nabble.com/User-f8781.html
>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/


_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|

Re: width of space changes in 'monospace font.

Frank Trampe
Did you change the metadata for both copies such that the editor would detect the bold version of the newly named type family?


On Sat, Feb 7, 2015 at 11:25 AM, Ray Andrews <[hidden email]> wrote:
On 02/07/2015 08:42 AM, Frank Trampe wrote:
Did you make a bold version of the new typeface, or is the editor automatically generating a bold face?

Automatic I think, whatever 'automatic' means! 

This is the font I copied:

DejaVuSansMono.ttf

And there is this one too:

DejaVuSansMono-Bold.ttf

... but I never touched it.  When I select my 'Test.ttf' font, it doesn't complain that a bold version is missing, or anything, it looks identical in every way except for the slightly narrower space.  Should I try copying the 'Bold' font too?
==========



On Saturday, February 7, 2015, Ray Andrews <[hidden email]> wrote:
> Gentlemen,
>
> I hope this isn't a double, I sent previously but it seems to have not
> made it to the list.
>
> My first effort with fontforge:  I copied a monospace .ttf font to
> another name, changed the identification strings and saved it without
> making any other changes.  The 'new' font shows up as being available,
> and I can select it and use it, however in my code editor (geany) when
> the font is bolded (that is when it is *not* showing commented code) the
> width of the space is about 1/12 too narrow, so the font no longer is
> truly monospace:
>
> #1234567890 this line is truly monospace
> #                   0 this line is truly monospace
> 01234567890 this line is truely monospace
> 0                    0 this line is NOT monospace, the spaces are narrower.
>
> How can I repair that?
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> fontforge-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/fontforge-users
> http://fontforge.10959.n7.nabble.com/User-f8781.html
>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/


_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|

Re: width of space changes in 'monospace font.

Ray Andrews
On 02/07/2015 12:36 PM, Frank Trampe wrote:
Did you change the metadata for both copies such that the editor would detect the bold version of the newly named type family?

No, I only made the one new font, didn't touch the bold version, but here's what puzzles me: since I didn't make a new bold font, then what was being used?  Did it default back to dejavusansmono-bold?  But *if* it did so, why is the spacing changed from that font?  And besides, in a previous attempt at a new font, I did make a few changes, and those changes *are* in the bolded font, even though I created only the one new font.  That tells me the bolding is somehow done within the single font.  So we're back to wondering why the width of the space has changed.

========================


On Sat, Feb 7, 2015 at 11:25 AM, Ray Andrews <[hidden email]> wrote:
On 02/07/2015 08:42 AM, Frank Trampe wrote:
Did you make a bold version of the new typeface, or is the editor automatically generating a bold face?

Automatic I think, whatever 'automatic' means! 

This is the font I copied:

DejaVuSansMono.ttf

And there is this one too:

DejaVuSansMono-Bold.ttf

... but I never touched it.  When I select my 'Test.ttf' font, it doesn't complain that a bold version is missing, or anything, it looks identical in every way except for the slightly narrower space.  Should I try copying the 'Bold' font too?
==========



On Saturday, February 7, 2015, Ray Andrews <[hidden email]> wrote:
> Gentlemen,
>
> I hope this isn't a double, I sent previously but it seems to have not
> made it to the list.
>
> My first effort with fontforge:  I copied a monospace .ttf font to
> another name, changed the identification strings and saved it without
> making any other changes.  The 'new' font shows up as being available,
> and I can select it and use it, however in my code editor (geany) when
> the font is bolded (that is when it is *not* showing commented code) the
> width of the space is about 1/12 too narrow, so the font no longer is
> truly monospace:
>
> #1234567890 this line is truly monospace
> #                   0 this line is truly monospace
> 01234567890 this line is truely monospace
> 0                    0 this line is NOT monospace, the spaces are narrower.
>
> How can I repair that?
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> fontforge-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/fontforge-users
> http://fontforge.10959.n7.nabble.com/User-f8781.html
>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/


_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html



------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/


_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|

Re: I cannot find some functions a Python scripting.

michinari.nukazawa
In reply to this post by Michel Boyer
Your advice was very helpful.
and a problem of baseline was settled.

Thank you.


#### Output .pe version
em:                         1000
ascent:                      900
descent:                     100
hhea_ascent:                1000
hhea_descent:                  0
hhea_linegap:                 90
os2_typoascent:              900
os2_typodescent:            -100
os2_typolinegap:              90
os2_winascent:              1000
os2_windescent:                0
hhea_ascent_add:               0
hhea_descent_add:              0
os2_typoascent_add:            0
os2_typodescent_add:           0
os2_winascent_add:             0
os2_windescent_add:            0
Output: RuneAMN_Pro_BlackletterPLow_1.20150208164951.otf

#### Output .py (improvement) version

em:                         1000
ascent:                      900
descent:                     100
hhea_ascent:                 889
hhea_descent:               -100
hhea_linegap:                 90
os2_typoascent:              900
os2_typodescent:            -100
os2_typolinegap:              90
os2_winascent:               889
os2_windescent:              100
hhea_ascent_add:               0
hhea_descent_add:              0
os2_typoascent_add:            0
os2_typodescent_add:           0
os2_winascent_add:             0
os2_windescent_add:            0
Output: RuneAMN_Pro_BlackletterPLow_1.20150208201346.otf

There is the difference, but the problem does not happen (on Illustrator for Windows).



On 2015年02月07日 23:31, Boyer Michel wrote:
Hi

The names given to those values varies too much to my taste between applications.
Before you get an answer from someone that took the time to read the source code (or some proper documentation), you can compare with the values given by the following script

Michel


for i in ["em", 
"ascent", 
"descent", 
"hhea_ascent", 
"hhea_descent", 
"hhea_linegap",
"os2_typoascent", 
"os2_typodescent", 
"os2_typolinegap",
"os2_winascent", 
"os2_windescent", 
"hhea_ascent_add", 
"hhea_descent_add", 
"os2_typoascent_add", 
"os2_typodescent_add",
"os2_winascent_add", 
"os2_windescent_add"]:
  print "%-25s %6s" % (i+":", eval("fnt."+i))

On Feb 7, 2015, at 4:38 AM, michinari.nukazawa <[hidden email]> wrote:

Hello.
Please help.

I porting my font build script to Python, from .pe format.
( https://github.com/MichinariNukazawa/RuneAMN_Pro_Series_Fonts/blob/gh-pages/font_generate.pe )

But I cannot find some functions from a document.


1. Set Baseline (before or after Imported SVG files).

    # Select(0u0020, 0u007e)
    # ScaleToEm((1000 - _baseline), _baseline)

2. Points location chop rounded.

    # RoundToInt()


3. Set Ascent/Descent

    # ディセント(フォント下端)
    # SetOS2Value("WinDescentIsOffset"  , 0)
    # SetOS2Value("HHeadDescentIsOffset", 0)
    # SetOS2Value("WinDescent"  , 0)
    # SetOS2Value("HHeadDescent", 0)
    # アセント(フォント高さ)
    # SetOS2Value("WinAscentIsOffset", 0)
    # SetOS2Value("HHeadAscentIsOffset" , 0)
    # SetOS2Value("WinAscent", 1000)
    # SetOS2Value("HHeadAscent" , 1000)

 I find function is:
     font.os2_windescent = 0
     font.os2_winascent = 1000
 want other OS2 field-names.



Thanks.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html



------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/


_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|

Re: I cannot find some functions a Python scripting.

Michel Boyer
Another value that appears to be relevant is OS/2 fsSelection bit 7, USE_TYPO_METRICS, cf http://www.microsoft.com/typography/otspec/os2.htm#fss
which would correspond to font.os2_use_typo_metrics

Michel

On Feb 8, 2015, at 6:49 AM, michinari.nukazawa <[hidden email]> wrote:

Your advice was very helpful.
and a problem of baseline was settled.

Thank you.


#### Output .pe version
em:                         1000
ascent:                      900
descent:                     100
hhea_ascent:                1000
hhea_descent:                  0
hhea_linegap:                 90
os2_typoascent:              900
os2_typodescent:            -100
os2_typolinegap:              90
os2_winascent:              1000
os2_windescent:                0
hhea_ascent_add:               0
hhea_descent_add:              0
os2_typoascent_add:            0
os2_typodescent_add:           0
os2_winascent_add:             0
os2_windescent_add:            0
Output: RuneAMN_Pro_BlackletterPLow_1.20150208164951.otf

#### Output .py (improvement) version

em:                         1000
ascent:                      900
descent:                     100
hhea_ascent:                 889
hhea_descent:               -100
hhea_linegap:                 90
os2_typoascent:              900
os2_typodescent:            -100
os2_typolinegap:              90
os2_winascent:               889
os2_windescent:              100
hhea_ascent_add:               0
hhea_descent_add:              0
os2_typoascent_add:            0
os2_typodescent_add:           0
os2_winascent_add:             0
os2_windescent_add:            0
Output: RuneAMN_Pro_BlackletterPLow_1.20150208201346.otf

There is the difference, but the problem does not happen (on Illustrator for Windows).



On 2015年02月07日 23:31, Boyer Michel wrote:
Hi

The names given to those values varies too much to my taste between applications.
Before you get an answer from someone that took the time to read the source code (or some proper documentation), you can compare with the values given by the following script

Michel


for i in ["em", 
"ascent", 
"descent", 
"hhea_ascent", 
"hhea_descent", 
"hhea_linegap",
"os2_typoascent", 
"os2_typodescent", 
"os2_typolinegap",
"os2_winascent", 
"os2_windescent", 
"hhea_ascent_add", 
"hhea_descent_add", 
"os2_typoascent_add", 
"os2_typodescent_add",
"os2_winascent_add", 
"os2_windescent_add"]:
  print "%-25s %6s" % (i+":", eval("fnt."+i))

On Feb 7, 2015, at 4:38 AM, michinari.nukazawa <[hidden email]> wrote:

Hello.
Please help.

I porting my font build script to Python, from .pe format.
( https://github.com/MichinariNukazawa/RuneAMN_Pro_Series_Fonts/blob/gh-pages/font_generate.pe )

But I cannot find some functions from a document.


1. Set Baseline (before or after Imported SVG files).

    # Select(0u0020, 0u007e)
    # ScaleToEm((1000 - _baseline), _baseline)

2. Points location chop rounded.

    # RoundToInt()


3. Set Ascent/Descent

    # ディセント(フォント下端)
    # SetOS2Value("WinDescentIsOffset"  , 0)
    # SetOS2Value("HHeadDescentIsOffset", 0)
    # SetOS2Value("WinDescent"  , 0)
    # SetOS2Value("HHeadDescent", 0)
    # アセント(フォント高さ)
    # SetOS2Value("WinAscentIsOffset", 0)
    # SetOS2Value("HHeadAscentIsOffset" , 0)
    # SetOS2Value("WinAscent", 1000)
    # SetOS2Value("HHeadAscent" , 1000)

 I find function is:
     font.os2_windescent = 0
     font.os2_winascent = 1000
 want other OS2 field-names.



Thanks.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html



------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/


_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|

Re: I cannot find some functions a Python scripting.

michinari.nukazawa
I found RoundToInt python alternative.

font.round()

Documentation text too match.
Thanks.

>>>> 2. Points location chop rounded.
>>>>
>>>>     # RoundToInt()
>>>>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html