from scipy import spatial tree = spatial.KDTree(t_list) # t_list is a list of pre-calculated point coordinate tuples on the cubic curve distance, index = tree.query(pt) # pt is the given point coordinate tuple t_for_pt = float(index) / (len(tree.data) - 1)

t_list must be constructed in a way that the first entry is for t = 0 and the last entry for t = 1. It doesn’t matter how many points for increments of t you calculate, as long as the index in t_list is proportional to t. Smaller increments of t increase the precision of the result, but the list takes longer to build.

]]>As I understand it, there may not be a solution to the equation if the given point is not exactly on the curve, which may already happen because floating point numbers are not exact. So you need to find t so that the distance of P(t) to the given point is minimized.

This stackexchange answer may be something, but I didn’t understand the stuff about inversions: https://math.stackexchange.com/a/535785

If you can make any sense of it, I am very interested :)

]]>I’ve just started testing this wonderful app for the first time in my life and I’m planning to rewrite my (at least for me) very useful plugin from the GlyphsApp: StemThickness (https://github.com/RafalBuchner/StemThickness).

For this purpose I need to find the nearest on-curve point for the coordinate of the cursor point. And I’ve found it:

(here: https://groups.google.com/forum/#!topic/robofab/YAG1RQO_mcc )

Right now I’m looking for something I would call “time of the on-curve point”. This is the ratio needed for further calculation for my extension.

Following equation is the standard equation for the bezier curve.

I have given B (coordinates of the nearest on-curve point), A, B, C, D (curve’s control points). I’m looking for “t” value:

B = (1 – t)^3*A + 3*(1 – t)^2 *t*B + 3*(1 – t) *t^2 *C + t^3 * D

, 0 <= t <= 1, t=?

Do you guys know any fast method for finding “t” value of given on-curve point and bezeir curve’s control points?

I hope that this message is quite clear :) I’m not the best at explaining math stuff at forums.

Cheers

Rafał

I think this has been asked before but I cannot find anything.

When generating an .otf and ticking autohint,

the output window or batch report will say

/bin/sh: autohintexe: command not found

for every glyph in the font.

Blue Values and StemSnap are set.

thanks, jo

]]>Thanks

]]>the agrave would be an example.

My a sidebearing L=51, R=69 and when composed agrave is L=51, R=60

It appears to be consistently subtracting different amounts of the right side bearing on component glyphs only, if that helps?

Is there is a way to output the process to a text file that could be inspected to see what’s happening? apologies for minimal knowledge in helping troubleshoot this.

Thanks.

]]>could you provide a real example?

it should take the metrics of the first component, in your example `agrave=a+grave@top`

the `agrave`

should have the same metrics as `a`

thanks

]]>However in some instances the side bearings of the base glyph (let’s say u) do not match the side bearings of uogonek.

Does anyone know how to create diacritics using components as mentioned above so that side bearings match base glyph?

]]>Thanks

]]>