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

Class tkfreetype2.NativeFT2Face


Synopsis: Represents 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
float–Ascender

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

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

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

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

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

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

 
→ top of page
Method openFileFace
Open a font face from the given local file
Signature
openFileFace(StringfileName,
  floatw,
  floath 
  )  
 :boolean
Arguments
StringfileName–Font file name
floatw–Char width
floath–Char height
Returns
boolean–true(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
Bufferb–Buffer that stores the compressed font data
floatw–Char width
floath–Char height
Returns
boolean–true(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
Objecttexture–Receives 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
Strings–Receives the font family name

 
→ top of page
Method storeGlyphsAdvanceX
Write the advancex for glyphs 0..255 to the given FloatArray
Signature
storeGlyphsAdvanceX(FloatArrayfa)
Arguments
FloatArrayfa–Receives 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
Strings–Receives 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