kuzminadya/mogeefont/2.0.0

NOTE: this package is not compatible with Elm 0.19.1

MogeeFont

This module exports a font that may be rendered with WebGL. Check the example.

type alias Letter =
{ width : Float
, height : Float
, textureX : Float
, textureY : Float
, x : Float
, y : Float
}

Specifies information about the letter:

  • width, height - dimensions on the texture
  • textureX, textureY - offset on the texture
  • x, y - coordinates in the printed text
text : (Letter -> List a) -> String -> List a

A function to print the text, that takes:

  • addLetter - function to print a letter
  • string - text to be printed

addLetter can for example return two triangles for each letter, to construct a WebGL mesh

spriteSrc : String

A black and white sprite containing all glyphs in the base64 data uri format. Can be loaded just as any remote url with Texture.load.