Re: Help finding code relating to changeWeight function

Thomas Shinnick <[email protected]>
Newsgroups gmane.comp.fonts.fontforge.devel
Message-ID <CAEfS-pjRsrKnd7Q8eLmzHjs58uUSDNz5Wvxw-a9ai+a26XMFgQ@mail.gmail.com>
I haven't used that API before, but it looks like it has many different
things it might do, depending on how you set the first couple of arguments.

  Python API docs:  http://fontforge.github.io/python.html

    on a Font or on Glyph   (*two* APIs)

      changeWeight     (stroke_width [,type, serif_height, serif_fuzz,
                                     counter_type, custom_zones] )

    docs refer to this for a discussion on "what it does"
          http://fontforge.github.io/Styles.html#Embolden

That discussion points out how much the changes might vary by the arguments
values, like whether the  width  is positive or negative, and then whether
you set the  type  argument to "CJK".  (looks like using the 2nd argument
then requires all the arguments?)

I start pointing to the code below, but perhaps an even better would be
your trying point out small/reduced test cases where you can show what
doesn't work as you expect?  That way we can all look at the
before/after/alternatives and investigate what's going on.

You could capture small SFD files (the intermediate internal format for
font files) and post them, saying or showing what acts weirdly/expectedly.
And wonderful/preferable would be using the GitHub for FontForge
<https://github.com/fontforge/fontforge/issues> pages to post a problem
report and your information.  You can even post screenshots!  (reduces the
"huh?"s)


  Python API 'changeWeight'

    On a Glyph
        in fontforge/python.c   (line 7380)

https://github.com/fontforge/fontforge/blob/88743f7cf92b52b5273ffaf3289179ba2bb9cced/fontforge/python.c#L7380-L7391

      calls CW_ParseArgs()      (line 7336)

https://github.com/fontforge/fontforge/blob/88743f7cf92b52b5273ffaf3289179ba2bb9cced/fontforge/python.c#L7336

      calls ScriptSCEmbolden()      (SC = SplineChar = Glyph)
          in fontforge/scstyles.c     (line 4316)

https://github.com/fontforge/fontforge/blob/a8d063488a8248dfeae9a1c2224f9af6247dc392/fontforge/scstyles.c#L4316-L4322

              calls PerGlyphInit()
              calls SCEmbolden()      (line 4017)

https://github.com/fontforge/fontforge/blob/a8d063488a8248dfeae9a1c2224f9af6247dc392/fontforge/scstyles.c#L4017

    On a Font
        in fontforge/python.c   (line 16148

https://github.com/fontforge/fontforge/blob/88743f7cf92b52b5273ffaf3289179ba2bb9cced/fontforge/python.c#L16148-L16162

      calls CW_ParseArgs()      (line 7336

https://github.com/fontforge/fontforge/blob/88743f7cf92b52b5273ffaf3289179ba2bb9cced/fontforge/python.c#L7336

      calls FVEmbolden()            (FV = a Font View)
          in fontforge/scstyles.c     (line 4291)

https://github.com/fontforge/fontforge/blob/a8d063488a8248dfeae9a1c2224f9af6247dc392/fontforge/scstyles.c#L4291-L4302

              calls PerGlyphInit()
              calls SCEmbolden()

Looks like the real fun starts in  SCEmbolden()in fontforge/scstyles.c ,
but that calls a *lot* of internal APIs....

On Wed, Dec 31, 2014 at 5:21 PM, Abraham Lee <[email protected]>
wrote:

> I have been using this wonderful program for roughly a year now and I'd
> like to make more use of the changeWeight function, but as I've played
> around with the function, I've noticed that it can be a little buggy
> whenever I do something automated (via the python API). I'd be more than
> happy to dig into the code myself and take a look at it, but I am not
> having much luck finding the corresponding code that drives the function.
> Can someone point me in the right direction? Thanks so much, again, and
> keep up the fabulous work!
>
> -Abraham Lee
>
> P.S. In case anyone is interested, I've mostly been using FF to create
> alternative music fonts for LilyPond, but I've also enjoyed making a few
> text fonts.
>
>
> ------------------------------------------------------------------------------
> 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
> [email protected]
> 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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
http://fontforge.10959.n7.nabble.com/Developer-f3.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.