mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 06:21:16 +01:00
Port the glyphy-demo to use the hb-gpu API. Builds as util/hb-gpu and requires GLEW, GLFW3, and OpenGL 3.3. Includes default text and embedded font for quick testing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
41 lines
865 B
C++
41 lines
865 B
C++
/*
|
|
* Copyright 2026 Behdad Esfahbod. All Rights Reserved.
|
|
*/
|
|
|
|
#ifndef DEMO_SHADERS_H
|
|
#define DEMO_SHADERS_H
|
|
|
|
#include "demo-common.h"
|
|
#include "demo-font.h"
|
|
|
|
|
|
struct glyph_vertex_t {
|
|
/* Object-space position */
|
|
GLfloat x;
|
|
GLfloat y;
|
|
/* Em-space texture coordinates */
|
|
GLfloat tx;
|
|
GLfloat ty;
|
|
/* Object-space outward normal at this vertex */
|
|
GLfloat nx;
|
|
GLfloat ny;
|
|
/* Em units per object-space unit (upem / font_size) */
|
|
GLfloat emPerPos;
|
|
/* Atlas offset (constant across glyph) */
|
|
GLuint atlas_offset;
|
|
};
|
|
|
|
void
|
|
demo_shader_add_glyph_vertices (const demo_point_t &p,
|
|
double font_size,
|
|
glyph_info_t *gi,
|
|
std::vector<glyph_vertex_t> *vertices,
|
|
demo_extents_t *extents);
|
|
|
|
|
|
GLuint
|
|
demo_shader_create_program (void);
|
|
|
|
|
|
#endif /* DEMO_SHADERS_H */
|