-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a package for HarfbuzzCairo (requires >= v7.0.0)
- Loading branch information
1 parent
b37ef41
commit 8f5b10d
Showing
8 changed files
with
123 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Extension { #name : #AeHbBuffer } | ||
|
||
{ #category : #'*Alexandrie-HarfbuzzCairo' } | ||
AeHbBuffer >> unownedGlyphsFrom: utf8 length: utf8Length xScaleFactor: xScaleFactor yScaleFactor: yScaleFactor intoGlyphs: glyphArrayAddress num: glyphArrayLengthAddress [ | ||
"See: https://harfbuzz.github.io/harfbuzz-hb-cairo.html#hb-cairo-glyphs-from-buffer" | ||
|
||
^ self | ||
ffiCall: #( | ||
void | ||
hb_cairo_glyphs_from_buffer ( | ||
self, | ||
false, | ||
double xScaleFactor, | ||
double yScaleFactor, | ||
double 0.0, | ||
double 0.0, | ||
const char *utf8, | ||
int utf8Length, | ||
void **glyphArrayAddress, | ||
uint *glyphArrayLengthAddress, | ||
nil, | ||
nil, | ||
nil ) ) | ||
library: AeHarfbuzzCairoLibrary | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
" | ||
I am a FFI binding for a `cairo_font_face_t` provided by Harfbuzz-Cairo integration. | ||
A `cairo_font_face_t` represents a particular font at a particular weight, slant, and other characteristic but not size or transformation. | ||
See: https://harfbuzz.github.io/integration-cairo.html | ||
See: https://harfbuzz.github.io/harfbuzz-hb-cairo.html | ||
See: https://www.cairographics.org/manual/cairo-cairo-font-face-t.html | ||
" | ||
Class { | ||
#name : #AeHbCairoFontFace, | ||
#superclass : #AeCairoFontFace, | ||
#category : #'Alexandrie-HarfbuzzCairo' | ||
} | ||
|
||
{ #category : #accessing } | ||
AeHbCairoFontFace >> scaleFactor [ | ||
"Answer the scale factor of this font face. Default scale factor is zero. | ||
See: https://harfbuzz.github.io/harfbuzz-hb-cairo.html#hb-cairo-font-face-get-scale-factor" | ||
|
||
^ self | ||
ffiCall: #( | ||
uint | ||
hb_cairo_font_face_get_scale_factor ( self ) ) | ||
library: AeHarfbuzzCairoLibrary | ||
] | ||
|
||
{ #category : #accessing } | ||
AeHbCairoFontFace >> scaleFactor: scaleFactor [ | ||
"Sets the scale factor of this font face. Default scale factor is zero. | ||
See: https://harfbuzz.github.io/harfbuzz-hb-cairo.html#hb-cairo-font-face-set-scale-factor" | ||
|
||
self | ||
ffiCall: #( | ||
void | ||
hb_cairo_font_face_set_scale_factor ( | ||
self, | ||
uint scaleFactor) ) | ||
library: AeHarfbuzzCairoLibrary | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Extension { #name : #AeHbFace } | ||
|
||
{ #category : #'*Alexandrie-HarfbuzzCairo' } | ||
AeHbFace >> newCairoFontFace [ | ||
"Answer a new `AeHbCairoFontFace` for rendering text according to this face." | ||
|
||
^ self unownedNewCairoFontFace | ||
autoRelease; | ||
yourself | ||
] | ||
|
||
{ #category : #'*Alexandrie-HarfbuzzCairo' } | ||
AeHbFace >> unownedNewCairoFontFace [ | ||
"Answer a new `AeHbCairoFontFace` for rendering text according to this face. | ||
Sender is responsible of destroying the new object. | ||
See: https://harfbuzz.github.io/harfbuzz-hb-cairo.html#hb-cairo-font-face-create-for-face" | ||
|
||
^ self | ||
ffiCall: #( | ||
AeHbCairoFontFace | ||
hb_cairo_font_face_create_for_face ( self ) ) | ||
library: AeHarfbuzzCairoLibrary | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Extension { #name : #AeHbFont } | ||
|
||
{ #category : #'*Alexandrie-HarfbuzzCairo' } | ||
AeHbFont >> newCairoFontFace [ | ||
"Answer a new `AeCairoFontFace` for rendering text according to this font. | ||
Note that the scale of font does not affect the rendering, but the variations and slant that are set on font do." | ||
|
||
^ self unownedNewCairoFontFace | ||
autoRelease; | ||
yourself | ||
] | ||
|
||
{ #category : #'*Alexandrie-HarfbuzzCairo' } | ||
AeHbFont >> unownedNewCairoFontFace [ | ||
"Answer a new `AeHbCairoFontFace` for rendering text according to this font. | ||
Note that the scale of font does not affect the rendering, but the variations and slant that are set on font do. | ||
Sender is responsible of destroying the new object. | ||
See: https://harfbuzz.github.io/harfbuzz-hb-cairo.html#hb-cairo-font-face-create-for-font" | ||
|
||
^ self | ||
ffiCall: #( | ||
AeHbCairoFontFace | ||
hb_cairo_font_face_create_for_font ( self ) ) | ||
library: AeHarfbuzzCairoLibrary | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Package { #name : #'Alexandrie-HarfbuzzCairo' } |