home
 
 index of namespace default
 
 index of project tkfreetype2
 
 index of module tkfreetype2

Class tkfreetype2.NativeFT2Face


SynopsisRepresents a freetype2 font face.  

  Base classes:
  Methods: Description:


For an example on how to use this class, take a look at the "testgl.tks" example script in the tkfreetype2 plugin directory.
The tkfreetype2 plugin is accompanied by a "freetype2.tks" support script which simplifies font handling/rendering.


 
 top of page
Method getAscender
Return the "minimal descender".
Signature
getAscender():float
Returns
floatAscender

 
 top of page
Method getDescender
Return the "maximal ascender".
Signature
getDescender():float
Returns
floatDescender

 
 top of page
Method getHeight
Return the actually selected font height.
Signature
getHeight():float
Returns
floatFont height

 
 top of page
Method getStyleFlags
Return the font style flags
Signature
getStyleFlags():int
Returns
intFont style flags, bit 0=italic, bit1=bold.

 
 top of page
Method getUnderlinePosition
Return the y position of the underline line
Signature
getUnderlinePosition():float
Returns
floatUnderline position

 
 top of page
Method getUnderlineThickness
Return the thickness of the underline line
Signature
getUnderlineThickness():float
Returns
floatUnderline thickness

 
 top of page
Method loadChar
Load a char glyph and return its extends in "ft2face"
Signature
loadChar(Classft2face,
  charc 
  )  
Arguments
Classft2faceReceives the glyph extends (class must have float fields "width", "height", "offsetx", "offsety", "advancex" !)
charcWhich character to load

 
 top of page
Method openFileFace
Open a font face from the given local file
Signature
openFileFace(StringfileName,
  floatw,
  floath 
  )  
 :boolean
Arguments
StringfileNameFont file name
floatwChar width
floathChar height
Returns
booleantrue(1) if the font has been opened, false(0) if an error occured.

 
 top of page
Method openMemoryFace
Open a font face from the given memory buffer.
Signature
openMemoryFace(Bufferb,
  floatw,
  floath 
  )  
 :boolean
Arguments
BufferbBuffer that stores the compressed font data
floatwChar width
floathChar height
Returns
booleantrue(1) if the font has been opened, false(0) if an error occured.

 
 top of page
Method renderGlyph
Render last loaded char glyph.
Signature
renderGlyph(Objecttexture)
Arguments
ObjecttextureReceives the char bitmap data
Description

The texture object must support the yacArrayGetStridE(), yacArrayGetPointer(), yacArrayGetWidth(), yacArrayGetHeight() calls. The bitmap data is written in 8bits per pixel format. If unsure, pass an instance of the Texture class.

 
 top of page
Method storeFamilyName
Write the font family name to the given string.
Signature
storeFamilyName(Strings)
Arguments
StringsReceives the font family name

 
 top of page
Method storeGlyphsAdvanceX
Write the advancex for glyphs 0..255 to the given FloatArray
Signature
storeGlyphsAdvanceX(FloatArrayfa)
Arguments
FloatArrayfaReceives the "advancex" float values for glyphs 0..255. The array must be able to hold at least 256 elements.

 
 top of page
Method storeStyleName
Write the font style name to the given string.
Signature
storeStyleName(Strings)
Arguments
StringsReceives the font style name

 
 top of page
 

Project Modules:tkfreetype2 
Project Classes:NativeFT2Face 
Project Functions:
All Namespaces:default , ui 
All Projects:core , debugtext , tkfreetype2 , tkmath , tkmidi , tkopengl , tkportaudio , tksdl , tkui , tkunit 


auto-generated by "DOG", the TkScript document generator. Mon, 28/Dec/2015 13:15:54