Cairo__FontFace.st
changeset 40 28dfc583beb5
parent 30 c8fe298c8cc7
child 43 1006839761af
--- a/Cairo__FontFace.st	Tue Feb 16 07:46:52 2016 +0000
+++ b/Cairo__FontFace.st	Wed Feb 17 06:43:31 2016 +0000
@@ -10,6 +10,24 @@
 !
 
 
+!FontFace class methodsFor:'instance creation'!
+
+fromFontDescription: aFontDescription
+    Screen current platformName == #X11 ifTrue:[ 
+        | pattern |
+
+        pattern := FcPattern fromFontDescription: aFontDescription.
+        ^ CPrimitives cairo_ft_font_face_create_for_pattern: pattern.
+    ].
+    self error: 'Noy yet implemented'.
+
+    "
+    Cairo::FontFace fromFontDescription: CodeView defaultFont
+    "
+
+    "Created: / 17-02-2016 / 20:01:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !FontFace class methodsFor:'accessing'!
 
 dllPath
@@ -56,6 +74,38 @@
     ^0
 ! !
 
+!FontFace methodsFor:'accessing'!
+
+referenceCount
+    "Return value or reference counter"
+
+    ^ CPrimitives cairo_font_face_get_reference_count: self
+
+    "Modified: / 17-02-2016 / 19:54:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+type
+    "This function returns the type of the backend used to create a font face. 
+     See FontType for available types."
+
+    ^ CPrimitives cairo_font_face_get_type: self
+
+    "Created: / 17-02-2016 / 19:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!FontFace methodsFor:'private'!
+
+destroy
+    "Tell Cairo library to destroy the corresponding C object.
+     Remember that object is physically destroyed only if internal
+     refcounter goes to zero. However, after calling destroy,
+     this instance should be treated as invalid."
+
+    ^ CPrimitives cairo_font_face_destroy: self
+
+    "Modified: / 17-02-2016 / 19:54:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !FontFace class methodsFor:'documentation'!
 
 version