[fontforge-users] Where is the changeWeight code?

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

[fontforge-users] Where is the changeWeight code?

Abraham Lee
Developers,

I have really enjoyed using FF over the past year, making both text and music fonts. I'd like to make more use of the changeWeight function, but I've had mixed experiences using it (via the python API) where I can't use it reliably. I am happy to dig into the code to figure out how to improve it, but I am not having any luck finding it in the repositories. Can anyone be so kind to point me in the right direction? Thanks so much and keep up the excellent work!

Happy New Year!
-Abraham

------------------------------------------------------------------------------
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: Where is the changeWeight code?

Frank Trampe
Hi, Abraham.

The Python changeWeight function is in fontforge/python.c. What problems are you experiencing?


On Wed, Dec 31, 2014 at 5:35 PM, Abraham Lee <[hidden email]> wrote:
Developers,

I have really enjoyed using FF over the past year, making both text and music fonts. I'd like to make more use of the changeWeight function, but I've had mixed experiences using it (via the python API) where I can't use it reliably. I am happy to dig into the code to figure out how to improve it, but I am not having any luck finding it in the repositories. Can anyone be so kind to point me in the right direction? Thanks so much and keep up the excellent work!

Happy New Year!
-Abraham

------------------------------------------------------------------------------
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: [fontforge-devel] Where is the changeWeight code?

Werner LEMBERG

> Well, it doesn't happen all the time, but occasionally I'll get
> extraneous lines that didn't exist prior to changing the weight or
> glyphs that are no longer closed (sometimes both).  [...]

You should stay with the old FontForge version from 2012...

> What do you think? I've also attached a trimmed down sfd of just
> that glyph for you to look at, if you'd like. The original (before)
> is definitely closed, so I don't see any reason why it would end up
> NOT closed after changing the weight (by +7 em-units). Guide layer:
> original; background: after manually increasing weight; foreground:
> after automatically changing weight (with python API).

Please file a bug report for FontForge.


    Werner

------------------------------------------------------------------------------
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: [fontforge-devel] Where is the changeWeight code?

Werner LEMBERG

>> Well, it doesn't happen all the time, but occasionally I'll get
>> extraneous lines that didn't exist prior to changing the weight or
>> glyphs that are no longer closed (sometimes both).  [...]
>
> You should stay with the old FontForge version from 2012...

Oops!  I've missed that you are writing to the fontforge list, not
lilypond :-)  Consequently, my advice makes no sense.

Anyways, it would be helpful to know whether the problem happens with
the old FontForge version also.  In case this isn't true, you would
become a hero by doing bisection.[*]


    Werner


[*] Since the build system changed completely since then, you would
    have to build fontforge from scratch after each bisection step,
    which is quite time consuming on a slow machine...

------------------------------------------------------------------------------
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: [fontforge-devel] Where is the changeWeight code?

Frank Trampe
Hi, Werner.

I'm still curious as to why using recent FontForge with LilyPond is bad news.


On Thu, Jan 8, 2015 at 12:31 AM, Werner LEMBERG <[hidden email]> wrote:

>> Well, it doesn't happen all the time, but occasionally I'll get
>> extraneous lines that didn't exist prior to changing the weight or
>> glyphs that are no longer closed (sometimes both).  [...]
>
> You should stay with the old FontForge version from 2012...

Oops!  I've missed that you are writing to the fontforge list, not
lilypond :-)  Consequently, my advice makes no sense.

Anyways, it would be helpful to know whether the problem happens with
the old FontForge version also.  In case this isn't true, you would
become a hero by doing bisection.[*]


    Werner


[*] Since the build system changed completely since then, you would
    have to build fontforge from scratch after each bisection step,
    which is quite time consuming on a slow machine...

------------------------------------------------------------------------------
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-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
http://fontforge.10959.n7.nabble.com/Developer-f3.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: [fontforge-devel] Where is the changeWeight code?

Werner LEMBERG

> I'm still curious as to why using recent FontForge with LilyPond is
> bad news.

It's the eternal problem with removing overlaps.  LilyPond uses
FontForge in batch mode as a postprocessor of mf2pt1 output to first
create a set of hinted and normalized Type 1 fonts, then merging all
such fonts into a master OpenType font.

Running a current FontForge on a 32bit GNU/Linux box, it fails
miserably for me, producing zillions of warnings together with invalid
output, while the old version works just fine.  Unfortunately, I
neither have the time nor a quick computer to find out which commit
caused this regression.


    Werner

------------------------------------------------------------------------------
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: [fontforge-devel] Where is the changeWeight code?

Frank Trampe
We made a lot of changes to the overlap removal functionality over the course of the last year, and I thought that we tested rather extensively. Can you supply a sample file that causes problems?


On Thu, Jan 8, 2015 at 12:57 AM, Werner LEMBERG <[hidden email]> wrote:

> I'm still curious as to why using recent FontForge with LilyPond is
> bad news.

It's the eternal problem with removing overlaps.  LilyPond uses
FontForge in batch mode as a postprocessor of mf2pt1 output to first
create a set of hinted and normalized Type 1 fonts, then merging all
such fonts into a master OpenType font.

Running a current FontForge on a 32bit GNU/Linux box, it fails
miserably for me, producing zillions of warnings together with invalid
output, while the old version works just fine.  Unfortunately, I
neither have the time nor a quick computer to find out which commit
caused this regression.


    Werner


------------------------------------------------------------------------------
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: [fontforge-devel] Where is the changeWeight code?

mskala
In reply to this post by Werner LEMBERG
On Thu, 8 Jan 2015, Werner LEMBERG wrote:
> It's the eternal problem with removing overlaps.  LilyPond uses
> FontForge in batch mode as a postprocessor of mf2pt1 output to first
> create a set of hinted and normalized Type 1 fonts, then merging all
> such fonts into a master OpenType font.

If the scripts involved are .pe scripts, I'd be interested to know whether
FontAnvil gives good results on them.  Its overlap removal is currently
working well for me in Tsukurimashou, which uses a very similar workflow
to what you describe for LilyPond (Metapost to Type 1 to OpenType).

--
Matthew Skala
[hidden email]                 People before principles.
http://ansuz.sooke.bc.ca/

------------------------------------------------------------------------------
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: [fontforge-devel] Where is the changeWeight code?

Werner LEMBERG

>> It's the eternal problem with removing overlaps.  LilyPond uses
>> FontForge in batch mode as a postprocessor of mf2pt1 output to
>> first create a set of hinted and normalized Type 1 fonts, then
>> merging all such fonts into a master OpenType font.
>
> If the scripts involved are .pe scripts, I'd be interested to know
> whether FontAnvil gives good results on them.  Its overlap removal
> is currently working well for me in Tsukurimashou, which uses a very
> similar workflow to what you describe for LilyPond (Metapost to Type
> 1 to OpenType).

It's a .pe script, yes, and it is waiting together with a sample input
font in the mailing list's approval queue.


    Werner

------------------------------------------------------------------------------
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: [fontforge-devel] Where is the changeWeight code?

mskala
In reply to this post by Frank Trampe
On Thu, 8 Jan 2015, Werner LEMBERG wrote:
> Running the attached script with
>
>   fontforge -script makelilyfont.pe feta20.pfb

Both FontAnvil and FontForge (current head revisions of each) seem to
produce correct font output from this example on my machine.

> I get
>
>   Internal Error (overlap) in scripts.reverseturn:

I see similar messages.  But do you get incorrect font output?  Random
error messages are to be expected from FontForge, and I suggest ignoring
them as long as the font output is okay.  Nonetheless, FontAnvil doesn't
produce these messages, and an earlier version of FontForge I just
overwrote (I think it was from last August) didn't either - so it's
possible something relevant has changed in FontForge since then.

--
Matthew Skala
[hidden email]                 People before principles.
http://ansuz.sooke.bc.ca/

------------------------------------------------------------------------------
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: [fontforge-devel] Where is the changeWeight code?

Frank Trampe
I believe that I added MergeIntersections, so that error report would not have appeared before, but there would likely have been silent problems from having nearly colocated intersections.

It seems that we are merging an intersection at an end point into another intersection (also at an end point), which breaks the calculation of the t-value of the intersection since the relocated intersection is not on the original spline. I am considering how best to fix this.

On Fri, Jan 9, 2015 at 11:45 AM, <[hidden email]> wrote:
On Thu, 8 Jan 2015, Werner LEMBERG wrote:
> Running the attached script with
>
>   fontforge -script makelilyfont.pe feta20.pfb

Both FontAnvil and FontForge (current head revisions of each) seem to
produce correct font output from this example on my machine.

> I get
>
>   Internal Error (overlap) in scripts.reverseturn:

I see similar messages.  But do you get incorrect font output?  Random
error messages are to be expected from FontForge, and I suggest ignoring
them as long as the font output is okay.  Nonetheless, FontAnvil doesn't
produce these messages, and an earlier version of FontForge I just
overwrote (I think it was from last August) didn't either - so it's
possible something relevant has changed in FontForge since then.

--
Matthew Skala
[hidden email]                 People before principles.
http://ansuz.sooke.bc.ca/


------------------------------------------------------------------------------
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: [fontforge-devel] Where is the changeWeight code?

Werner LEMBERG
In reply to this post by mskala

>> I get
>>
>>   Internal Error (overlap) in scripts.reverseturn:
>
> I see similar messages.  But do you get incorrect font output?

Well, I haven't checked it this time, but previously such error
messages always indicated very serious issues.  Given that we are
using FontForge in script mode only, it must run without any errors.

> Random error messages are to be expected from FontForge, and I
> suggest ignoring them as long as the font output is okay.

I strongly disagree.  Software that produces 'random error messages'
is bad for any production pipeline.  Usually, we have two LilyPond
developer releases a month – noone has the time to regularly check
whether the created fonts are valid!  We *must* be able to rely that
FontForge produces valud results.  For us, the 'old' FontForge release
works, and recent versions produce errors, so it's easy to guess what
we are using by default.


    Werner
------------------------------------------------------------------------------
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