From 0ca8e044b267cd831528a414a3be18f770631c43 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 5 Aug 2014 22:18:22 -0400 Subject: [PATCH] add Font_RenderGlyph() --- src/Font.cc | 12 +++++++++++- src/Font.h | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Font.cc b/src/Font.cc index 8567f0d..74ef8d3 100644 --- a/src/Font.cc +++ b/src/Font.cc @@ -1,5 +1,4 @@ #include "Font.h" -#include "ruby.h" #include "GLTexture.h" #include #include @@ -186,3 +185,14 @@ bool Glyph::load(FT_Face face, FT_ULong char_code) m_loaded = true; return true; } + +void Font_RenderGlyph(VALUE font_obj, unsigned long char_code) +{ + Font * font; + Data_Get_Struct(font_obj, Font, font); + GlyphRef g = get_glyph(font, char_code); + if (g != NULL) + { + g->render(); + } +} diff --git a/src/Font.h b/src/Font.h index 92aaaea..d1a85bc 100644 --- a/src/Font.h +++ b/src/Font.h @@ -1,6 +1,9 @@ #ifndef JES_FONT_H #define JES_FONT_H +#include "ruby.h" + void Font_Init(); +void Font_RenderGlyph(VALUE font_obj, unsigned long char_code); #endif