GithubHelp home page GithubHelp logo

opengl-text's Introduction

Overview

This is a Common Lisp library for texture mapped fonts in OpenGL.

Dependencies

  • cl-opengl
  • iterate
  • alexandria
  • cl-vectors
  • zpb-ttf
  • ffa
  • trivial-garbage

Usage

Font and other information is stored in an instance of opengl-text class. Important initargs are:

  • :font a zpb-ttf font loader
  • :emsquare somewhat misnamed, more or less the side of a square containing a single glyph.
  • :length length of string there are preallocated vertex buffers for. Default is 20.

Their respective accessors are font-loader-of, emsquare-of and length-of, which are all setfable.

Only the characters actually used are drawn on the texture. It might be useful to use ensure-characters (sequence opengl-text-object) function to avoid pauses when characters are first used.

Dynamic variable *auto-extend-buffers* controls whether vertex/texture coordinates buffers are automatically extended when string is drawn longer that length. Setting it to nil might be useful if a longer string is only rarely drawn.

The function draw-gl-string (string opengl-text-object &key kerning) renders a series of rectangles textured with proper letters in the current RGBA color. No newlines are allowed. The size is normalized so that a font em square (~font size) is one unit in OpenGL coordinate system.

Note

There is an experimental branch using other ways to store the texture, inluding mipmaps, polygon and outline font. The code there is even less tested and in desperate need of refactoring though, which may or may not happen in the future.

opengl-text's People

Contributors

dtorop avatar ramarren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.