File tree 5 files changed +700
-242
lines changed 5 files changed +700
-242
lines changed Original file line number Diff line number Diff line change 1
- module_version = " 1.4.6 "
1
+ module_version = " 1.4.7 "
2
2
3
3
haveDepCtrl, DependencyControl = pcall require , " l0.DependencyControl"
4
4
Original file line number Diff line number Diff line change @@ -115,6 +115,8 @@ class Line
115
115
. internal_leading = textMetrics. internal_leading
116
116
. external_leading = textMetrics. external_leading
117
117
118
+ font\ free! if IS_UNIX
119
+
118
120
-- text alignment
119
121
{ : an} = . data
120
122
@@ -486,7 +488,9 @@ class Line
486
488
-- sets new values
487
489
lineBlock. data. scale_x = 100
488
490
lineBlock. data. scale_y = 100
489
- textExtents = Font ( lineBlock. data) \ getTextExtents lineBlock. text_stripped
491
+ font = Font lineBlock. data
492
+ textExtents = font\ getTextExtents lineBlock. text_stripped
493
+ font\ free! if IS_UNIX
490
494
lineBlock. width = textExtents. width
491
495
lineBlock. height = textExtents. height
492
496
-- converts the text to shape and then converts the shape to Path
@@ -718,7 +722,11 @@ class Line
718
722
return x * w, y * w
719
723
720
724
-- converts the text to shape
721
- toShape : ( l) -> Font ( l. data) \ getTextToShape l. text_stripped
725
+ toShape : ( l) ->
726
+ font = Font l. data
727
+ shape = font\ getTextToShape l. text_stripped
728
+ font\ free! if IS_UNIX
729
+ return shape
722
730
723
731
-- converts the text to Path
724
732
toPath : ( l) -> Path Line . toShape l
Original file line number Diff line number Diff line change 21
21
-- Font scale values for increased size & later downscaling to produce floating point coordinates
22
22
export FONT_UPSCALE = 64
23
23
export FONT_DOWNSCALE = 1 / FONT_UPSCALE
24
+ export IS_UNIX = jit. os != " Windows"
24
25
25
- if jit . os == " Windows "
26
+ unless IS_UNIX
26
27
-- if the operating system is windows
27
28
import WindowsGDI from require " ILL.ILL.Font.Win"
28
29
return { Font : WindowsGDI }
29
30
30
31
-- if the operating system is unix
31
- import PangoCairo from require " ILL.ILL.Font.Unx"
32
- return { Font : PangoCairo }
32
+ import FreeType from require " ILL.ILL.Font.Unx"
33
+ return { Font : FreeType }
You can’t perform that action at this time.
0 commit comments