Categorygithub.com/jasonpfox/gltext
modulepackage
0.0.0-20180307033527-0cb49edd9bd9
Repository: https://github.com/jasonpfox/gltext.git
Documentation: pkg.go.dev

# README

Modern opengl text rendering

A simple package for rendering a string using modern opengl. Based on the bounding box of a string, positioning of the string on screen prior to rendering is possible. There do seem to be issues with the dimensions reported by freetype-go unfortunately.

  • Unicode support.
  • Dynamic text zooming along the z-axis.
  • Dynamic text positioning within the orthographic projection space.
  • Dynamic color changes.

Unicode support is based on the underlying truetype font being used (or bitmap).

Alt text

Install

  • go get github.com/4ydx/gltext

Example

  • Provided using Japanese text.

Dependencies

This packages uses freetype-go which is licensed under GPLv2 and FTL licenses. You can choose which one is a better fit for your use case but FTL requires you to give some form of credit to Freetype.org

License

Copyright 2012 The go-gl Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
IsPow2 returns true if the given value is a power-of-two.
No description provided by the author
No description provided by the author
No description provided by the author
LoadTruetype loads a truetype font from the given stream and applies the given font scale in points.
Pow2 returns the first power-of-two value >= to n.
Pow2Image returns the given image, scaled to the smallest power-of-two dimensions larger or equal to the input dimensions.
PrintVBO prints the individual index locations as well as the texture locations (0,0) (x1,y1): This shows the layout of the runes.
No description provided by the author
No description provided by the author

# Variables

No description provided by the author

# Structs

FontConfig describes raster font metadata.
No description provided by the author
A Glyph describes metrics for a single font glyph.
RuneRanges specify the rune ranges for ordered disjoint subsets of the ttf EG 32 - 127, 5000 - 6000 will created a more compact bitmap that holds the specified ranges of runes.

# Interfaces

No description provided by the author

# Type aliases

A Charset represents a set of glyph descriptors for a font.
Direction represents the direction in which strings should be rendered.
No description provided by the author