Giter Club home page Giter Club logo

Comments (12)

rougier avatar rougier commented on May 26, 2024

How do you get first point off curve for a cubic Bézier considering the explicit form? You mean given first point doesn't correspond to t=0, right?

from freetype-py.

HinTak avatar HinTak commented on May 26, 2024

A while ago there was a discussion on the Opentype list about this sort of thing. It is legal for a curve to consist of entirely off-curve points. Say 4, at the corner of a square. The rasterizer interpolates them. That was the answer from Microsoft people.

So an implied on-curve point is between the first and the last.

I think it can be even more extreme - a contour can be made from 3 off-curve points. Font designers rarely do it, that's all.

from freetype-py.

rougier avatar rougier commented on May 26, 2024

Didn't know that. Do you have a pointer to some documentation such that we can add it in the relevant example (where I'm asking to rephrase). It's not the example is not optimal but it is more a partial implementation.

from freetype-py.

HinTak avatar HinTak commented on May 26, 2024

http://stackoverflow.com/questions/20733790/truetype-fonts-glyph-are-made-of-quadratic-bezier-why-do-more-than-one-consecu

from freetype-py.

rougier avatar rougier commented on May 26, 2024

But freetype outline takes care of normalizing the output, no?
See https://www.freetype.org/freetype2/docs/glyphs/glyphs-6.html)

from freetype-py.

rougier avatar rougier commented on May 26, 2024

Ok, no it doesn't, we have to take care of point tags.

from freetype-py.

HinTak avatar HinTak commented on May 26, 2024

You do interpolate most of the time - just afaic, not the first point; and also always split a 3-order curve into two, with an interpolation in the middle. Difference small but for some glyph, might be visible.

from freetype-py.

rougier avatar rougier commented on May 26, 2024

So we better implement the full method.

from freetype-py.

HinTak avatar HinTak commented on May 26, 2024

3rd curves only on postscript fonts. 2nd order is sufficient for truetype.

from freetype-py.

HinTak avatar HinTak commented on May 26, 2024

I hope this is shown side by side - left interpolated 2nd order, right true-3rd order:

glyph-vector-2-cairo-interpolated
glyph-vector-2-cairo-real

and again, with the control points,, which make it clearer:

glyph-vector-cairo-s--interpoloated-minionpro-regular otf
glyph-vector-cairo-real

correct answer from ftgrid:
screenshot from 2017-05-02 22-57-41

These are using MinionPro-Regular.otf from adobe acrobat reader.

from freetype-py.

HinTak avatar HinTak commented on May 26, 2024

Hmm, my 'g' is a bit off in the horizonal direction for the MinionPro-Regular.otf

from freetype-py.

HinTak avatar HinTak commented on May 26, 2024

These are the g's from MinionPro-Regular.otf and MinionPro-It.otf, correctly aligned in the horizontal. from
the top of #55 .

glyph-vector-2-cairo-it
glyph-vector-2-cairo

from freetype-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.