DEATHSHADOW'S
MADNESS
Madness and You, Perfect together!

  1. Top of Page
  2. Main Menu
  3. Page Content
  4. Page Extras
  5. Bottom of Page

Type tglKernedFont

Declaration


tglKernedFont=object
  name:string;
  texture:gluInt;
  info:tglKernedHeader;
  renderX,renderY,renderZ,
  charGlHeight,
  charAddWidth,charAddHeight,charSpacing,
  charScale,charScaleWidth,charScaleHeight:glFloat;
  lastKern:tglKernedChar;
  constructor init(fontName:string; glHeight:glFloat);
  procedure scale(s:glFloat);
  procedure setposition(x,y,z:glFloat);
  function stringSize(st:string):glFloat;
  procedure writeChar(ch:char);
  procedure writeString(st:string);
  procedure writeStringCentered(st:string);
  procedure writeStringRight(st:string);
  destructor term;
end;

Purpose

The primary object users should call when including the glKernedFont unit to access and render .glkfont files.

Properties

name : string;

Name of the font currently loaded into the object

texture : gluInt;

openGL texture handler

info : tglKernedHeader;

The structure as read from the .glkfont file.

renderX, renderY, renderZ : glFloat

The cursor offset position for the writeChar procedure.

charGlHeight : glFloat

The height you want the font to be in OpenGL metrics. This value should only be set by the init constructor.

charAddWidth,charAddheight : glFloat

The amount to add to the texture offset coordinates to provide the other corner of the character. Calculated so as to prevent openGL from accidentally rendering parts of the next character in the texture.

charSpacing : glFloat

The space between characters. This is one of the few variables the end user may want to try modifying to change how far apart characters are. Think of this as similar to the CSS property "letter-spacing"

charScale,charScaleWidth,charScaleHeight : glFloat

The scaling ratios as set by the scale function. These should probably not be modified directly.

lastKern : tglKernedChar

The kerning info for the last character rendered. Various functions that change positioning and scaling will reset the values in this to zero.

Methods

Please refer to each method's individual page

  1. Top of Page
  2. Main Menu
  3. Page Content
  4. Page Extras
  5. Bottom of Page