All Projects → opcon → Quickfont

opcon / Quickfont

Licence: mit
A Modern OpenGL Font Rendering Library for OpenTK

Projects that are alternatives of or similar to Quickfont

Innocenceengine
Cross-platform modern game engine.
Stars: ✭ 149 (+136.51%)
Mutual labels:  opengl, rendering, cross-platform
Raz
Modern & multiplatform game engine in C++17
Stars: ✭ 161 (+155.56%)
Mutual labels:  opengl, rendering, cross-platform
Ncine
A cross-platform 2D game engine
Stars: ✭ 372 (+490.48%)
Mutual labels:  opengl, rendering, cross-platform
Arxlibertatis
Cross-platform port of Arx Fatalis, a first-person role-playing game
Stars: ✭ 602 (+855.56%)
Mutual labels:  opengl, cross-platform
Lighthouse2
Lighthouse 2 framework for real-time ray tracing
Stars: ✭ 542 (+760.32%)
Mutual labels:  opengl, rendering
Pyrender
Easy-to-use glTF 2.0-compliant OpenGL renderer for visualization of 3D scenes.
Stars: ✭ 582 (+823.81%)
Mutual labels:  opengl, rendering
Lasercrabs
Launch your LASERCRAB at walls, ceilings, and enemy heads in this indie multiplayer shooter where "move" and "attack" are synonymous.
Stars: ✭ 465 (+638.1%)
Mutual labels:  opengl, cross-platform
Vidcutter
Been busy guys, will be reviewing and integrating pull requests shortly. Thanks to all contributors! LATEST RELEASE: 6.0.0 - flatpak @ https://flathub.org/apps/details/com.ozmartians.VidCutter - snap @ https://snapcraft.io/vidcutter - see https://github.com/ozmartian/vidcutter/releases for more details...
Stars: ✭ 775 (+1130.16%)
Mutual labels:  opengl, cross-platform
Fauxgl
Software-only 3D renderer written in Go.
Stars: ✭ 658 (+944.44%)
Mutual labels:  opengl, rendering
Sfml
Simple and Fast Multimedia Library
Stars: ✭ 7,316 (+11512.7%)
Mutual labels:  opengl, cross-platform
Metalpetal
A GPU accelerated image and video processing framework built on Metal.
Stars: ✭ 907 (+1339.68%)
Mutual labels:  opengl, rendering
Bulllord Engine
lightspeed lightweight elegant game engine in pure c
Stars: ✭ 539 (+755.56%)
Mutual labels:  opengl, cross-platform
Olive
Free open-source non-linear video editor
Stars: ✭ 5,682 (+8919.05%)
Mutual labels:  opengl, cross-platform
Glchaos.p
3D GPUs Strange Attractors and Hypercomplex Fractals explorer - up to 256 Million particles in RealTime
Stars: ✭ 590 (+836.51%)
Mutual labels:  opengl, rendering
Renderhelp
⚡️ 可编程渲染管线实现,帮助初学者学习渲染
Stars: ✭ 494 (+684.13%)
Mutual labels:  opengl, rendering
Expo Crossy Road
🐥🚙 Crossy Road game clone made in Expo (iOS, Android, web), THREE.js, Tween, React Native. 🐔
Stars: ✭ 701 (+1012.7%)
Mutual labels:  opengl, cross-platform
Glumpy
Python+Numpy+OpenGL: fast, scalable and beautiful scientific visualization
Stars: ✭ 882 (+1300%)
Mutual labels:  opengl, rendering
Dotfeather
A closs-platform generic gameengine built on C#/.NET Standard 2.1
Stars: ✭ 28 (-55.56%)
Mutual labels:  opengl, cross-platform
Shaderworkshop
Interactive GLSL fragment shaders editor made with Qt
Stars: ✭ 43 (-31.75%)
Mutual labels:  opengl, rendering
Tprpix
a Cross-Platform, 2D Survival Sandbox Game Project. Based on C++17/cmake/OpenGL/SQLite3.
Stars: ✭ 448 (+611.11%)
Mutual labels:  opengl, cross-platform

QuickFont Join the chat at https://gitter.im/opcon/QuickFont Build Status Build status NuGet

A modern OpenGL text rendering library for OpenTK.

Forked from swax/QuickFont library. Original Library QFont

You can install this library via nuget.

Supported Platforms

QuickFont has been tested and runs on Windows, Linux and OSX.

The minimum supported OpenGL version is 3.0

Note the example project will need to be changed to build correctly on OSX, since by default Apple returns an OpenGL 2.1 context if a specific version is not specified.

Simply replace the Game.cs constructor with:

public Game()
	: base(800, 600, GraphicsMode.Default, "QuickFont Example", GameWindowFlags.Default, DisplayDevice.Default, 3, 2, GraphicsContextFlags.Default)

This will select an OpenGL version >= 3.2 (usually 4.1).

Changelog

Latest Release - Version 4.5

  • Update to OpenTK 3.1
  • Add FAKE build script
  • Support loading FreeType fonts from memory

Previous Releases:

Version 4.4

  • Updated to OpenTK 2.0 and SharpFont 4.0.1
  • Added fallback to builtin kerning if font file does not have any
  • Switch to using paket for dependency management rather than nuget
  • Added OSX and Linux continuous integration through travis-ci
  • Added a custom view-model-matrix to QFontDrawingPrimitive which allows for some fun effects - see Example
  • Improved inbuilt documentation

Version 4.3

  • Kerning information is now loaded from FreeType if FreeTypeFont is used
  • Improved built in kerning method to account for pixels on glyph boundary
  • Fixes to example project
  • Improved overall code quality
    • Renamed variables to a consistent naming scheme
    • Added XML documentation to all public facing classes, methods, fields, properties, etc.
    • Added lots of XML documentation to internal/private classes, methods, fields, properties etc
  • Fixed QFontDrawing not implementing IDisposable
  • Improved disposing in QVertexArrayObject

Version 4.2

  • Switched to using a shared package to build QuickFont
  • Added an OpenGL ES 2.0 nuget package

Version 4.1

  • Updated font loading mechanism to use SharpFont for loading fonts by path, and use the regular GDIFont mechanism for loading installed (system) fonts
  • Updated example project to show some different installed system fonts

Version 4.0

  • Now uses SharpFont for loading the font files, so custom (non-installed) fonts are now supported on Linux and OSX
  • Added Nuget package
  • Added support for OpenGL ES (requires conditional compilation) thanks to vescon
  • Improved Shader loading
  • Cross-platform support (tested on Windows 10, Ubuntu 15.10, OSX 10.11,10.10)
  • Unicode support
  • Example is working again
  • Updated to latest OpenTK nuget package (OpenTK.Next)

Todo

  • [ ] Maybe extract all Print methods in a static class to leave QFontDrawingPrimitive more basic.
  • [ ] Right to Left text flow support (arabic, hebrew)
  • [ ] Unicode zero spacing eg. combining character support
  • [ ] On-the-fly character addition (If a character can not be found, add it, regenerate the font)

Screenshot

Example

In some OnLoad() method create your QFont and your QFontDrawing

_myFont = new QFont("Fonts/HappySans.ttf", 72, new QFontBuilderConfiguration(true));
_myFont2 = new QFont("basics.qfont", new QFontBuilderConfiguration(true));
_drawing = new QFontDrawing();

Call some print methods or create Drawing primitives by themselves. Add them to the drawing.

_drawing.DrawingPrimitives.Clear();
_drawing.Print(_myFont, "text1", pos, FontAlignment.Left);

// draw with options
var textOpts = new QFontRenderOptions()
    {
	Colour = Color.FromArgb(new Color4(0.8f, 0.1f, 0.1f, 1.0f).ToArgb()),
	DropShadowActive = true
	};
SizeF size = _drawing.Print(_myFont, "text2", pos2, FontAlignment.Left, textOpts);

var dp = new QFontDrawingPrimitive(_myFont2);
size = dp.Print(text, new Vector3(bounds.X, Height - yOffset, 0), new SizeF(maxWidth, float.MaxValue), alignment);
drawing.DrawingPrimitives.Add(dp);

// after all changes do update buffer data and extend it's size if needed.
_drawing.RefreshBuffers();

Then in your draw loop do:

_drawing.ProjectionMatrix = proj;
_drawing.Draw();
SwapBuffers();

At the end of the program dispose the QuickFont resources:

protected virtual void Dispose(bool disposing)
{
	_drawing.Dispose();
	_myFont.Dispose();
	_myFont2.Dispose();
}

See the included example project for more!

Contributors

The following is a non-exhaustive list of people who have contributed to QuickFont:

James Lohr - Creator of the original library (http://www.opentk.com/project/QuickFont)

John (swax) Marshall - Added vertex buffer support

Patrick (opcon) Yates - Current maintainer

Robertofon - Refactored monolithic QFont class

Martinay - OpenGL ES 2.0 support

Jan Polak

Jonathan

License

Licensed under MIT, please see the file License.txt in the project root directory

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].