Brucey преди 3 години
родител
ревизия
04b4620f65
променени са 2 файла, в които са добавени 11 реда и са изтрити 47 реда
  1. 2 46
      freetype.mod/freetype.bmx
  2. 9 1
      freetype.mod/glue.c

+ 2 - 46
freetype.mod/freetype.bmx

@@ -119,6 +119,8 @@ Function bmx_freetype_Face_size:Byte Ptr(ft_face:Byte Ptr)
 Function bmx_freetype_Size_height:Int(ft_size:Byte Ptr)
 Function bmx_freetype_Size_ascend:Int(ft_size:Byte Ptr)
 Function bmx_freetype_Size_descend:Int(ft_size:Byte Ptr)
+Function bmx_freetype_Face_family_name:String(ft_face:Byte Ptr)
+Function bmx_freetype_Face_style_name:String(ft_face:Byte Ptr)
 
 Function bmx_freetype_Slot_bitmapleft:Int(slot:Byte Ptr)
 Function bmx_freetype_Slot_bitmaptop:Int(slot:Byte Ptr)
@@ -151,49 +153,3 @@ Const FT_RENDER_MODE_LIGHT=1
 Const FT_RENDER_MODE_MONO=2
 Const FT_RENDER_MODE_LCD=3
 Const FT_RENDER_MODE_LCD_V=4
-
-
-Type FTFace
-	Field	numfaces,index,flags,style,numglyphs
-	Field	fname:Byte Ptr
-	Field	sname:Byte Ptr
-	Field	numsizes
-	Field	sizes:Int Ptr
-	Field	numcharmaps
-	Field	charmaps:Int Ptr
-	Field	genericdata:Byte Ptr,genericdestructor
-	Field	bx0,by0,bx1,by1
-	Field	unitsperem:Short
-	Field	ascender:Short
-	Field	descender:Short
-	Field	height:Short
-	Field	maxawidth:Short
-	Field	maxahieght:Short
-	Field	underlinepos:Short
-	Field	underlinethick:Short
-	Field	glyphslot:Int Ptr	
-	Field	metrics:Byte Ptr
-End Type	
-
-Type FTMetrics
-	Field	mface,mgeneric0,mgeneric1
-	Field	xppem:Short,yppem:Short
-	Field	xscale,yscale
-	Field	ascend,descend,height,max_advance
-End Type
-	
-Type FTGlyph
-	Field	lib,face,nextglyph,reserved
-	Field	genericdata:Byte Ptr,genericdestructor	
-	Field	metric_width,metric_height,metric_horibearingx,metric_horibearingy
-	Field	metric_horiadvance,metric_vertbearingx,metric_vertbearingy,metric_vertadvance
-	Field	hadvance,vadvance
-    Field	advancex,advancey
-	Field	glyphformat
-'bitmap
-	Field	rows,width,pitch
-	Field	buffer:Byte Ptr
-	Field	numgreys:Short,pixel_mode:Byte,palette_mode:Byte
-	Field	palette:Byte Ptr
-	Field	bitmap_left,bitmap_top
-End Type

+ 9 - 1
freetype.mod/glue.c

@@ -1,7 +1,8 @@
-
 #include <ft2build.h>
 #include FT_FREETYPE_H
 
+#include "brl.mod/blitz.mod/blitz.h"
+
 int bmx_freetype_Face_numglyphs(FT_Face ft_face) {
 	return ft_face->num_glyphs;
 }
@@ -58,3 +59,10 @@ unsigned char * bmx_freetype_Slot_bitmap_buffer(FT_GlyphSlot slot) {
 	return slot->bitmap.buffer;
 }
 
+BBString * bmx_freetype_Face_family_name(FT_Face ft_face) {
+	return bbStringFromUTF8String((unsigned char*)ft_face->family_name);
+}
+
+BBString * bmx_freetype_Face_style_name(FT_Face ft_face) {
+	return bbStringFromUTF8String((unsigned char*)ft_face->style_name);
+}