Skip to content

Commit

Permalink
Double-dispatch with newCairoFontFace
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchodias committed Mar 1, 2024
1 parent 93eceaf commit f9ecbf1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/Alexandrie-Cairo/AeFTFace.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Extension { #name : #AeFTFace }

{ #category : #'*Alexandrie-Cairo' }
AeFTFace >> newCairoFontFace [
"Answer a new `AeCairoFreetypeFontFace` for rendering text according to this face."

^ AeCairoFreetypeFontFace newForFace: self
]
4 changes: 2 additions & 2 deletions src/Alexandrie-Canvas/AeCanvas.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,11 @@ AeCanvas >> restoreContextOnlyIfClipAfterwards: aBlock [
]

{ #category : #'API - text' }
AeCanvas >> scaledFontForFace: aFTFace size: pointSize [
AeCanvas >> scaledFontForFace: aFace size: pointSize [
"Answer a `AeCairoScaledFont` that corresponds to the provided face and point size."

| aCairoFontFace aFontMatrix |
aCairoFontFace := AeCairoFreetypeFontFace newForFace: aFTFace.
aCairoFontFace := aFace newCairoFontFace.
aFontMatrix := AeCairoMatrix newScalingByX: pointSize y: pointSize.

^ aCairoFontFace
Expand Down

0 comments on commit f9ecbf1

Please sign in to comment.