コード例 #1
0
        public static void nk_font_query_font_glyph(NkFont font, float height, NkUserFontGlyph *glyph, char codepoint,
                                                    char next_codepoint)
        {
            float          scale;
            nk_font_glyph *g;


            if ((font == null) || (glyph == null))
            {
                return;
            }
            scale           = (float)(height / font.Info.height);
            g               = nk_font_find_glyph(font, codepoint);
            glyph->width    = (float)((g->x1 - g->x0) * scale);
            glyph->height   = (float)((g->y1 - g->y0) * scale);
            glyph->offset   = (NkVec2)(nk_vec2_((float)(g->x0 * scale), (float)(g->y0 * scale)));
            glyph->xadvance = (float)(g->xadvance * scale);
            glyph->uv_x[0]  = g->u0;
            glyph->uv_y[0]  = g->v0;
            glyph->uv_x[1]  = g->u1;
            glyph->uv_y[1]  = g->v1;
        }
コード例 #2
0
ファイル: Nuklear.cs プロジェクト: raizam/NuklearSharp
 public void query_font_glyph(NkHandle h, float height, NkUserFontGlyph *glyph, char codepoint,
                              char nextCodepoint)
 {
     Nk.nk_font_query_font_glyph(this, height, glyph, codepoint, nextCodepoint);
 }