Lines Matching defs:glyph
235 #define NK_UTF_SIZE 4 /* describes the number of bytes a glyph consists of*/
3792 of a bigger font atlas texture and a callback to query a character's glyph
3802 void query_your_font_glyph(nk_handle handle, float font_height, struct nk_user_font_glyph *glyph, nk_rune codepoint, nk_rune next_codepoint)
3805 glyph.width = ...;
3806 glyph.height = ...;
3807 glyph.xadvance = ...;
3808 glyph.uv[0].x = ...;
3809 glyph.uv[0].y = ...;
3810 glyph.uv[1].x = ...;
3811 glyph.uv[1].y = ...;
3812 glyph.offset.x = ...;
3813 glyph.offset.y = ...;
3853 for every selected glyph to image by calling `nk_font_atlas_bake`.
3899 struct nk_user_font_glyph *glyph,
3907 /* offset between top left and glyph */
3909 /* size of the glyph */
3911 /* offset to the next glyph */
3924 /* font glyph callback to query drawing info */
3943 /* glyph array offset inside the font glyph baking output array */
3945 /* number of glyphs of this font inside the glyph baking array output */
3981 /* fallback glyph to use if a given rune is not found */
4029 /* some language glyph codepoint ranges */
8364 nk_glyph glyph;
8369 byte_len = nk_utf_encode(text[i], glyph, NK_UTF_SIZE);
8371 nk_str_append_text_char(str, glyph, byte_len);
8379 nk_glyph glyph;
8384 byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE);
8385 nk_str_append_text_char(str, glyph, byte_len);
8493 nk_glyph glyph;
8498 byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE);
8500 nk_str_insert_at_rune(str, pos+i, glyph, byte_len);
8508 nk_glyph glyph;
8513 byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE);
8514 nk_str_insert_at_rune(str, pos+i, glyph, byte_len);
10361 /* draw every glyph image */
10368 /* query currently drawn glyph information */
10373 /* calculate and draw glyph drawing rectangle and image */
10381 /* offset next glyph */
10979 int indexToLocFormat; /* format needed to map from glyph index to glyph */
11139 /* the same regardless of glyph. */
11275 if (glyph_index >= info->numGlyphs) return -1; /* glyph index out of range */
11276 if (info->indexToLocFormat >= 2) return -1; /* unknown index->glyph map format */
11497 /* Get indexed glyph. */
11582 int glyph, float scale_x, float scale_y,float shift_x, float shift_y,
11586 if (!nk_tt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) {
11601 nk_tt_GetGlyphBitmapBox(const struct nk_tt_fontinfo *font, int glyph,
11604 nk_tt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y,0.0f,0.0f, ix0, iy0, ix1, iy1);
12233 float shift_x, float shift_y, int glyph, struct nk_allocator *alloc)
12237 int num_verts = nk_tt_GetGlyphShape(info, alloc, glyph, &vertices);
12240 nk_tt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x,
12463 int glyph = nk_tt_FindGlyphIndex(info, codepoint);
12464 nk_tt_GetGlyphBitmapBoxSubpixel(info,glyph, scale * (float)spc->h_oversample,
12511 int glyph = nk_tt_FindGlyphIndex(info, codepoint);
12520 nk_tt_GetGlyphHMetrics(info, glyph, &advance, &lsb);
12521 nk_tt_GetGlyphBitmapBox(info, glyph, scale * (float)spc->h_oversample,
12526 scale * (float)spc->v_oversample, 0,0, glyph, alloc);
12904 /* fill own baked font glyph array */
12912 struct nk_font_glyph *glyph;
12914 /* query glyph bounds from stb_truetype */
12921 /* fill own glyph type with data */
12922 glyph = &glyphs[dst_font->glyph_offset + dst_font->glyph_count + (unsigned int)glyph_count];
12923 glyph->codepoint = codepoint;
12924 glyph->x0 = q.x0; glyph->y0 = q.y0;
12925 glyph->x1 = q.x1; glyph->y1 = q.y1;
12926 glyph->y0 += (dst_font->ascent + 0.5f);
12927 glyph->y1 += (dst_font->ascent + 0.5f);
12928 glyph->w = glyph->x1 - glyph->x0 + 0.5f;
12929 glyph->h = glyph->y1 - glyph->y0;
12932 glyph->u0 = q.s0 * (float)width;
12933 glyph->v0 = q.t0 * (float)height;
12934 glyph->u1 = q.s1 * (float)width;
12935 glyph->v1 = q.t1 * (float)height;
12937 glyph->u0 = q.s0;
12938 glyph->v0 = q.t0;
12939 glyph->u1 = q.s1;
12940 glyph->v1 = q.t1;
12942 glyph->xadvance = (pc->xadvance + cfg->spacing.x);
12944 glyph->xadvance = (float)(int)(glyph->xadvance + 0.5f);
13028 /* query currently drawn glyph information */
13032 /* offset next glyph */
13041 struct nk_user_font_glyph *glyph, nk_rune codepoint, nk_rune next_codepoint)
13047 NK_ASSERT(glyph);
13053 if (!font || !glyph)
13058 glyph->width = (g->x1 - g->x0) * scale;
13059 glyph->height = (g->y1 - g->y0) * scale;
13060 glyph->offset = nk_vec2(g->x0 * scale, g->y0 * scale);
13061 glyph->xadvance = (g->xadvance * scale);
13062 glyph->uv[0] = nk_vec2(g->u0, g->v0);
13063 glyph->uv[1] = nk_vec2(g->u1, g->v1);
13072 const struct nk_font_glyph *glyph = 0;
13080 glyph = font->fallback;
13092 return glyph;
13748 /* allocate glyph memory for all fonts */
14029 nk_input_glyph(struct nk_context *ctx, const nk_glyph glyph)
14039 len = nk_utf_decode(glyph, &unicode, NK_UTF_SIZE);
14049 nk_glyph glyph;
14052 glyph[0] = c;
14053 nk_input_glyph(ctx, glyph);