These are chat archives for jheinen/GR.jl

17th
Aug 2017
zjroth
@zjroth
Aug 17 2017 20:52

I'm saving some figures as SVG files. I'm a bit confused about how font sizing works relative to the supplied font size, and I can't get the produced font to be exactly the desired size. I found the following relevant code:

w, h = plt[:size]
px_per_pt = px / pt
_gr_point_mult[1] = 1.5 * px_per_pt / max(h, w)

and

GR.setcharheight(_gr_point_mult[1] * f.pointsize)

where f.pointsize will be the desired font size (e.g., 12). Also, the gr documentation says

setcharheight defines the height of subsequent text output primitives. Text height is defined as a percentage of the default window. GR uses the default text height of 0.027 (2.7% of the height of the default window).

But this doesn't shed much light for me.