Пример #1
0
        public static void nk_font_query_font_glyph(nk_font font, float height, nk_user_font_glyph *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   = (nk_vec2)(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
 public void query_font_glyph(nk_handle h, float height, nk_user_font_glyph *glyph, char codepoint,
                              char next_codepoint)
 {
     nk_font_query_font_glyph(this, height, glyph, codepoint, next_codepoint);
 }