Skip to content

Commit

Permalink
Use in Cairo the same default font name as in Skia
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchodias committed Sep 17, 2021
1 parent 9117933 commit cd7a6ab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Sparta-Cairo/SpartaCairoFreetypeFontBuilder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SpartaCairoFreetypeFontBuilder >> build [
| aFamilyName theFallbackFonts aLogicalFont |

aFamilyName := (fontList isNil or: [ fontList isEmpty ])
ifTrue: [ StandardFonts defaultFont familyName ]
ifTrue: [ self defaultName ]
ifFalse: [ fontList first ].

theFallbackFonts := fontList ifNotNil: [
Expand Down
8 changes: 4 additions & 4 deletions src/Sparta-Core/FFIExternalResourceManager.extension.st
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Extension { #name : #FFIExternalResourceManager }

{ #category : #'*Sparta-Core' }
FFIExternalResourceManager >> removeResource: oldObject [
registry remove: oldObject ifAbsent: [ ]
FFIExternalResourceManager class >> removeResource: oldObject [
self uniqueInstance removeResource: oldObject
]

{ #category : #'*Sparta-Core' }
FFIExternalResourceManager class >> removeResource: oldObject [
self uniqueInstance removeResource: oldObject
FFIExternalResourceManager >> removeResource: oldObject [
registry remove: oldObject ifAbsent: [ ]
]

{ #category : #'*Sparta-Core' }
Expand Down
6 changes: 6 additions & 0 deletions src/Sparta-Core/SpartaFontBuilder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ SpartaFontBuilder >> defaultLanguage [
^ 'en'
]

{ #category : #initialization }
SpartaFontBuilder >> defaultName [

^ 'Helvetica'
]

{ #category : #initialization }
SpartaFontBuilder >> defaultSize [
^ 14
Expand Down
2 changes: 1 addition & 1 deletion src/Sparta-Skia/SkiaFontBuilder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SkiaFontBuilder >> build [
| aSpartaFontFace theFontsDictionary |

aSpartaFontFace := SpartaFontFace new
familyName: (familyName ifNil: [ 'Helvetica' ]);
familyName: (familyName ifNil: [ self defaultName ]);
weight: weight;
stretch: stretch;
style: style.
Expand Down

0 comments on commit cd7a6ab

Please sign in to comment.