mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 16:31:14 +01:00
Replace the manual getopt-based demo main with the standard main_font_text_t / shape_consumer_t composition, getting all harfbuzz options for free: --variations, --features, --script, --direction, --face-index, --font-funcs, etc. New gpu_output_t (in util/gpu-output.hh) implements the output interface, feeding shaped glyphs to the demo's GL renderer. Add demo_buffer_add_glyph() and demo_buffer_current_line() to demo-buffer for glyph-at-a-time insertion (vs the old batch add_text which did its own shaping). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
54 lines
1.3 KiB
Meson
54 lines
1.3 KiB
Meson
gpu_demo_sources = files(
|
|
'demo-atlas.h',
|
|
'demo-atlas.cc',
|
|
'demo-buffer.h',
|
|
'demo-buffer.cc',
|
|
'demo-common.h',
|
|
'demo-font.h',
|
|
'demo-font.cc',
|
|
'demo-glstate.h',
|
|
'demo-glstate.cc',
|
|
'demo-shader.h',
|
|
'demo-shader.cc',
|
|
'demo-view.h',
|
|
'demo-view.cc',
|
|
'matrix4x4.h',
|
|
'matrix4x4.c',
|
|
'trackball.h',
|
|
'trackball.c',
|
|
)
|
|
|
|
gpu_demo_shaders = [
|
|
[ 'demo-fragment.glsl', 'demo-fragment-glsl.h', 'demo_fragment_glsl' ],
|
|
[ 'demo-vertex.glsl', 'demo-vertex-glsl.h', 'demo_vertex_glsl' ],
|
|
[ 'default-text.txt', 'default-text.h', 'default_text' ],
|
|
]
|
|
|
|
gpu_stringize = find_program('../../src/stringize')
|
|
|
|
gpu_demo_generated = []
|
|
|
|
foreach p: gpu_demo_shaders
|
|
glsl = p.get(0)
|
|
header = p.get(1)
|
|
decl = p.get(2)
|
|
gpu_demo_generated += custom_target('@0@ shader'.format(glsl),
|
|
input: glsl,
|
|
output: header,
|
|
capture: true,
|
|
command: [ gpu_stringize, 'static const char *' + decl, '@INPUT@' ])
|
|
endforeach
|
|
|
|
hexify = find_program('hexify')
|
|
|
|
gpu_demo_generated += custom_target('default font',
|
|
input: 'default-font.ttf',
|
|
output: 'default-font.h',
|
|
capture: true,
|
|
command: [ hexify, 'static const char default_font[]', '@INPUT@' ])
|
|
|
|
glew_dep = dependency('glew', required: false)
|
|
glfw_dep = dependency('glfw3', required: false)
|
|
gl_dep = dependency('gl', required: false)
|
|
have_gpu_demo_deps = glew_dep.found() and glfw_dep.found() and gl_dep.found()
|