ray 0.1.0.pre1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +235 -32
- data/Rakefile +20 -49
- data/ext/audio.c +68 -0
- data/ext/audio_source.c +197 -0
- data/ext/buffer_renderer.c +130 -0
- data/ext/color.c +179 -0
- data/ext/drawable.c +446 -0
- data/ext/event.c +337 -0
- data/ext/extconf.rb +80 -6
- data/ext/font.c +97 -0
- data/ext/gl.c +114 -0
- data/ext/gl_buffer.c +224 -0
- data/ext/gl_index_buffer.c +202 -0
- data/ext/gl_int_array.c +139 -0
- data/ext/gl_vertex.c +157 -0
- data/ext/image.c +263 -0
- data/ext/image_target.c +84 -0
- data/ext/input.c +53 -0
- data/ext/matrix.c +374 -0
- data/ext/music.c +113 -0
- data/ext/polygon.c +426 -0
- data/ext/ray.c +59 -0
- data/ext/ray.h +168 -0
- data/ext/rect.c +255 -0
- data/ext/say.h +31 -0
- data/ext/say_all.h +77 -0
- data/ext/say_arial.h +14689 -0
- data/ext/say_array.c +124 -0
- data/ext/say_array.h +34 -0
- data/ext/say_audio.c +64 -0
- data/ext/say_audio.h +170 -0
- data/ext/say_audio_context.c +40 -0
- data/ext/say_audio_source.c +96 -0
- data/ext/say_basic_type.c +17 -0
- data/ext/say_basic_type.h +47 -0
- data/ext/say_buffer.c +277 -0
- data/ext/say_buffer.h +37 -0
- data/ext/say_buffer_renderer.c +121 -0
- data/ext/say_buffer_renderer.h +33 -0
- data/ext/say_buffer_slice.c +247 -0
- data/ext/say_buffer_slice.h +29 -0
- data/ext/say_clean_up.c +14 -0
- data/ext/say_context.c +163 -0
- data/ext/say_context.h +26 -0
- data/ext/say_drawable.c +350 -0
- data/ext/say_drawable.h +100 -0
- data/ext/say_error.c +27 -0
- data/ext/say_event.h +213 -0
- data/ext/say_font.c +335 -0
- data/ext/say_font.h +51 -0
- data/ext/say_image.c +283 -0
- data/ext/say_image.h +52 -0
- data/ext/say_image_target.c +134 -0
- data/ext/say_image_target.h +25 -0
- data/ext/say_imp.h +70 -0
- data/ext/say_index_buffer.c +90 -0
- data/ext/say_index_buffer.h +29 -0
- data/ext/say_index_buffer_slice.c +227 -0
- data/ext/say_index_buffer_slice.h +28 -0
- data/ext/say_input.c +35 -0
- data/ext/say_matrix.c +314 -0
- data/ext/say_matrix.h +55 -0
- data/ext/say_music.c +225 -0
- data/ext/say_osx.h +62 -0
- data/ext/say_osx_context.h +98 -0
- data/ext/say_osx_window.h +766 -0
- data/ext/say_polygon.c +358 -0
- data/ext/say_polygon.h +62 -0
- data/ext/say_renderer.c +42 -0
- data/ext/say_renderer.h +22 -0
- data/ext/say_shader.c +375 -0
- data/ext/say_shader.h +91 -0
- data/ext/say_sound.c +67 -0
- data/ext/say_sound_buffer.c +96 -0
- data/ext/say_sprite.c +273 -0
- data/ext/say_sprite.h +53 -0
- data/ext/say_string.c +9 -0
- data/ext/say_table.c +86 -0
- data/ext/say_table.h +24 -0
- data/ext/say_target.c +264 -0
- data/ext/say_target.h +67 -0
- data/ext/say_text.c +441 -0
- data/ext/say_text.h +56 -0
- data/ext/say_thread.c +46 -0
- data/ext/say_thread.h +39 -0
- data/ext/say_thread_variable.c +44 -0
- data/ext/say_utf.c +62 -0
- data/ext/say_vertex_type.c +113 -0
- data/ext/say_vertex_type.h +40 -0
- data/ext/say_vfile.c +57 -0
- data/ext/say_view.c +150 -0
- data/ext/say_view.h +44 -0
- data/ext/say_win.h +24 -0
- data/ext/say_win_context.h +91 -0
- data/ext/say_win_window.h +670 -0
- data/ext/say_window.c +155 -0
- data/ext/say_window.h +43 -0
- data/ext/say_x11.h +41 -0
- data/ext/say_x11_context.h +96 -0
- data/ext/say_x11_window.h +818 -0
- data/ext/shader.c +302 -0
- data/ext/sound.c +118 -0
- data/ext/sound_buffer.c +75 -0
- data/ext/sprite.c +241 -0
- data/ext/stb_image.h +4971 -0
- data/ext/stb_image_write.h +511 -0
- data/ext/target.c +184 -0
- data/ext/text.c +162 -0
- data/ext/utils.c +10 -0
- data/ext/vector.c +261 -0
- data/ext/vendor/freetype/bin/freetype6.dll +0 -0
- data/ext/vendor/freetype/bin/zlib1.dll +0 -0
- data/ext/vendor/freetype/include/freetype2/freetype/config/ftconfig.h +350 -0
- data/ext/vendor/freetype/include/freetype2/freetype/config/ftheader.h +729 -0
- data/ext/vendor/freetype/include/freetype2/freetype/config/ftmodule.h +22 -0
- data/ext/vendor/freetype/include/freetype2/freetype/config/ftoption.h +695 -0
- data/ext/vendor/freetype/include/freetype2/freetype/config/ftstdlib.h +180 -0
- data/ext/vendor/freetype/include/freetype2/freetype/freetype.h +3434 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftbbox.h +94 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftbdf.h +200 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftbitmap.h +206 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftcache.h +1110 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftchapters.h +100 -0
- data/ext/vendor/freetype/include/freetype2/freetype/fterrdef.h +239 -0
- data/ext/vendor/freetype/include/freetype2/freetype/fterrors.h +206 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftgasp.h +113 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftglyph.h +575 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftgxval.h +358 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftgzip.h +102 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftimage.h +1237 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftincrem.h +331 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftlcdfil.h +166 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftlist.h +273 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftlzw.h +99 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftmac.h +272 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftmm.h +378 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftmodapi.h +406 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftmoderr.h +155 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftotval.h +198 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftoutln.h +526 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftpfr.h +172 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftrender.h +229 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftsizes.h +159 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftsnames.h +170 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftstroke.h +716 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftsynth.h +73 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftsystem.h +346 -0
- data/ext/vendor/freetype/include/freetype2/freetype/fttrigon.h +350 -0
- data/ext/vendor/freetype/include/freetype2/freetype/fttypes.h +583 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftwinfnt.h +263 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ftxf86.h +80 -0
- data/ext/vendor/freetype/include/freetype2/freetype/t1tables.h +450 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ttnameid.h +1132 -0
- data/ext/vendor/freetype/include/freetype2/freetype/tttables.h +756 -0
- data/ext/vendor/freetype/include/freetype2/freetype/tttags.h +99 -0
- data/ext/vendor/freetype/include/freetype2/freetype/ttunpat.h +59 -0
- data/ext/vendor/freetype/include/ft2build.h +61 -0
- data/ext/vendor/freetype/lib/freetype-bcc.lib +0 -0
- data/ext/vendor/freetype/lib/freetype6.def +249 -0
- data/ext/vendor/freetype/lib/libfreetype.dll.a +0 -0
- data/ext/vendor/freetype/lib/tmp.freetype.lib +0 -0
- data/ext/vendor/glew/LICENSE.txt +73 -0
- data/ext/vendor/glew/README.txt +18 -0
- data/ext/vendor/glew/include/GL/glew.h +15507 -0
- data/ext/vendor/glew/include/GL/glxew.h +1568 -0
- data/ext/vendor/glew/include/GL/wglew.h +1361 -0
- data/ext/vendor/glew/lib/glew32.dll +0 -0
- data/ext/vendor/glew/lib/glew32mx.dll +0 -0
- data/ext/vendor/glew/lib/libglew32.a +0 -0
- data/ext/vendor/glew/lib/libglew32.dll.a +0 -0
- data/ext/vendor/glew/lib/libglew32mx.a +0 -0
- data/ext/vendor/glew/lib/libglew32mx.dll.a +0 -0
- data/ext/vendor/openal/COPYING +484 -0
- data/ext/vendor/openal/Win32/soft_oal.dll +0 -0
- data/ext/vendor/openal/include/AL/al.h +724 -0
- data/ext/vendor/openal/include/AL/alc.h +277 -0
- data/ext/vendor/openal/include/AL/alext.h +165 -0
- data/ext/vendor/openal/include/AL/efx-creative.h +3 -0
- data/ext/vendor/openal/include/AL/efx.h +758 -0
- data/ext/vendor/openal/lib/libOpenAL32.dll.a +0 -0
- data/ext/vendor/sndfile/bin/libsndfile-1.dll +0 -0
- data/ext/vendor/sndfile/include/sndfile.h +666 -0
- data/ext/vendor/sndfile/include/sndfile.hh +422 -0
- data/ext/vendor/sndfile/lib/libsndfile-1.def +41 -0
- data/ext/vendor/sndfile/lib/libsndfile-1.lib +0 -0
- data/ext/vertex.c +96 -0
- data/ext/view.c +131 -0
- data/ext/window.c +183 -0
- data/lib/ray/animation.rb +248 -0
- data/lib/ray/animation/block_animation.rb +36 -0
- data/lib/ray/animation/circular_motion.rb +57 -0
- data/lib/ray/animation/color_variation.rb +102 -0
- data/lib/ray/animation/combination.rb +71 -0
- data/lib/ray/animation/float_variation.rb +76 -0
- data/lib/ray/animation/sequence.rb +65 -0
- data/lib/ray/animation/sprite_animation.rb +68 -0
- data/lib/ray/animation/vector_variation.rb +111 -0
- data/lib/ray/animation_list.rb +50 -0
- data/lib/ray/audio.rb +4 -7
- data/lib/ray/buffer_renderer.rb +9 -0
- data/lib/ray/color.rb +41 -6
- data/lib/ray/drawable.rb +34 -9
- data/lib/ray/dsl.rb +6 -0
- data/lib/ray/dsl/event.rb +1 -1
- data/lib/ray/dsl/event_listener.rb +14 -10
- data/lib/ray/dsl/event_raiser.rb +5 -2
- data/lib/ray/dsl/event_runner.rb +4 -10
- data/lib/ray/dsl/event_translator.rb +67 -99
- data/lib/ray/dsl/handler.rb +1 -1
- data/lib/ray/dsl/matcher.rb +40 -27
- data/lib/ray/event.rb +22 -0
- data/lib/ray/font.rb +0 -42
- data/lib/ray/font_set.rb +3 -7
- data/lib/ray/game.rb +33 -73
- data/lib/ray/gl/int_array.rb +24 -0
- data/lib/ray/gl/vertex.rb +106 -0
- data/lib/ray/helper.rb +25 -11
- data/lib/ray/image.rb +9 -154
- data/lib/ray/image_set.rb +3 -8
- data/lib/ray/image_target.rb +12 -0
- data/lib/ray/matrix.rb +90 -0
- data/lib/ray/music.rb +12 -0
- data/lib/ray/polygon.rb +77 -0
- data/lib/ray/ray.rb +45 -13
- data/lib/ray/rect.rb +14 -3
- data/lib/ray/resource_set.rb +18 -35
- data/lib/ray/scene.rb +43 -81
- data/lib/ray/scene_list.rb +12 -5
- data/lib/ray/shader.rb +82 -0
- data/lib/ray/sound.rb +18 -0
- data/lib/ray/sound_buffer.rb +6 -0
- data/lib/ray/sound_buffer_set.rb +32 -0
- data/lib/ray/sprite.rb +111 -97
- data/lib/ray/target.rb +18 -0
- data/lib/ray/text.rb +80 -58
- data/lib/ray/text_helper.rb +21 -27
- data/lib/ray/turtle.rb +49 -38
- data/lib/ray/vector.rb +76 -1
- data/lib/ray/vertex.rb +24 -0
- data/lib/ray/view.rb +47 -0
- data/lib/ray/window.rb +23 -0
- data/samples/_media/Beep.wav +0 -0
- data/samples/_media/CptnRuby Gem.png +0 -0
- data/samples/_media/CptnRuby Map.txt +25 -0
- data/samples/_media/CptnRuby Tileset.png +0 -0
- data/samples/_media/CptnRuby.png +0 -0
- data/samples/_media/Space.png +0 -0
- data/samples/_media/Star.png +0 -0
- data/samples/_media/Starfighter.png +0 -0
- data/samples/animation/chain.rb +33 -0
- data/samples/animation/circle.rb +38 -0
- data/samples/animation/color.rb +18 -0
- data/samples/animation/rotation.rb +17 -0
- data/samples/animation/sequence.rb +33 -0
- data/samples/animation/shader.rb +65 -0
- data/samples/animation/sprite_motion.rb +103 -0
- data/samples/animation/translation.rb +23 -0
- data/samples/audio/spacial.rb +25 -11
- data/samples/buffer/buffer.rb +28 -0
- data/samples/buffer/index_buffer.rb +36 -0
- data/samples/buffer/renderer.rb +27 -0
- data/samples/cptn_ruby/cptn_ruby.rb +279 -0
- data/samples/hello_world/hello.rb +2 -2
- data/samples/hello_world/hello_dsl.rb +3 -3
- data/samples/hello_world/text.rb +2 -2
- data/samples/opengl/cube.rb +124 -0
- data/samples/opengl/image.rb +36 -16
- data/samples/opengl/obj_loader.rb +99 -0
- data/samples/opengl/opengl.rb +24 -18
- data/samples/opengl/shader.rb +36 -26
- data/samples/pong/pong.rb +41 -39
- data/samples/{run_scene.rb → scenes/run_scene.rb} +21 -7
- data/samples/shaders/geometry.rb +98 -0
- data/samples/shaders/scene.rb +19 -12
- data/samples/shaders/shaders.rb +34 -17
- data/samples/shaders/shape.rb +12 -7
- data/samples/sokoban/level_1 +11 -7
- data/samples/sokoban/sokoban.rb +36 -63
- data/samples/starfighter/starfighter.rb +159 -0
- data/samples/test/actual_scene.rb +3 -3
- data/samples/test/scene_riot.rb +4 -4
- data/samples/test/scene_spec.rb +3 -3
- data/samples/test/scene_test_unit.rb +1 -1
- data/samples/turtle/byzantium.rb +10 -5
- data/samples/turtle/hilbert.rb +16 -11
- data/samples/turtle/koch.rb +16 -11
- data/samples/turtle/mandala.rb +43 -38
- data/samples/turtle/tree.rb +13 -8
- data/samples/view/resize.rb +26 -0
- data/samples/view/view.rb +35 -0
- data/samples/window/all_events.rb +44 -0
- data/samples/window/change_title.rb +16 -0
- data/samples/window/fullscreen.rb +18 -0
- data/samples/window/get_pixel.rb +29 -0
- data/samples/window/icon.rb +88 -0
- data/samples/window/input.rb +27 -0
- data/samples/window/no_border.rb +16 -0
- data/samples/window/resize.rb +24 -0
- data/test/animation/color_variation_test.rb +64 -0
- data/test/animation/combination_test.rb +35 -0
- data/test/animation/float_variation_test.rb +75 -0
- data/test/animation/vector_variation_test.rb +123 -0
- data/test/animation_list_test.rb +122 -0
- data/test/animation_test.rb +83 -0
- data/test/audio_test.rb +88 -33
- data/test/buffer_renderer_test.rb +38 -0
- data/test/color_test.rb +31 -22
- data/test/drawable_test.rb +207 -7
- data/test/dsl_test.rb +25 -7
- data/test/font_test.rb +6 -40
- data/test/game_test.rb +76 -0
- data/test/gl_buffer_test.rb +26 -0
- data/test/gl_index_buffer_test.rb +17 -0
- data/test/gl_vertex_test.rb +117 -0
- data/test/helpers.rb +45 -5
- data/test/image_target_test.rb +19 -0
- data/test/image_test.rb +73 -53
- data/test/int_array_test.rb +64 -0
- data/test/matrix_test.rb +134 -0
- data/test/polygon_test.rb +126 -0
- data/test/rect_test.rb +6 -8
- data/test/res/frag.c +14 -0
- data/test/res/frag3d.c +10 -0
- data/test/res/frag_gray.c +17 -0
- data/test/res/frag_light3d.c +20 -0
- data/test/res/light3d.c +20 -0
- data/test/res/sprite.png +0 -0
- data/test/res/teapot.obj +12831 -0
- data/test/res/vert.c +17 -0
- data/test/res/vertex3d.c +14 -0
- data/test/resource_set_test.rb +8 -45
- data/test/run_all.rb +1 -1
- data/test/scene_list_test.rb +79 -0
- data/test/scene_test.rb +168 -0
- data/test/shader_test.rb +58 -0
- data/test/sprite_test.rb +46 -41
- data/test/target_test.rb +34 -0
- data/test/text_test.rb +20 -31
- data/test/turtle_test.rb +35 -20
- data/test/vector_test.rb +61 -19
- data/test/vertex_test.rb +43 -0
- data/test/view_test.rb +61 -0
- metadata +347 -126
- data/.yardopts +0 -4
- data/VERSION +0 -1
- data/ext/audio.cpp +0 -723
- data/ext/color.cpp +0 -159
- data/ext/drawable.cpp +0 -91
- data/ext/event.cpp +0 -460
- data/ext/font.cpp +0 -190
- data/ext/image.cpp +0 -733
- data/ext/input.cpp +0 -74
- data/ext/ray.cpp +0 -168
- data/ext/ray.hpp +0 -356
- data/ext/rect.cpp +0 -245
- data/ext/shader.cpp +0 -169
- data/ext/shape.cpp +0 -409
- data/ext/sprite.cpp +0 -306
- data/ext/text.cpp +0 -181
- data/ext/vector.cpp +0 -215
- data/guide.md +0 -619
- data/lib/ray/input.rb +0 -10
- data/lib/ray/music_set.rb +0 -37
- data/lib/ray/rmagick.rb +0 -41
- data/lib/ray/shape.rb +0 -132
- data/lib/ray/sound_set.rb +0 -37
- data/samples/opengl/binding.rb +0 -38
- data/test/ray_test.rb +0 -25
- data/test/shape_test.rb +0 -101
- data/yard_ext.rb +0 -63
@@ -0,0 +1,170 @@
|
|
1
|
+
/***************************************************************************/
|
2
|
+
/* */
|
3
|
+
/* ftsnames.h */
|
4
|
+
/* */
|
5
|
+
/* Simple interface to access SFNT name tables (which are used */
|
6
|
+
/* to hold font names, copyright info, notices, etc.) (specification). */
|
7
|
+
/* */
|
8
|
+
/* This is _not_ used to retrieve glyph names! */
|
9
|
+
/* */
|
10
|
+
/* Copyright 1996-2001, 2002, 2003, 2006 by */
|
11
|
+
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
12
|
+
/* */
|
13
|
+
/* This file is part of the FreeType project, and may only be used, */
|
14
|
+
/* modified, and distributed under the terms of the FreeType project */
|
15
|
+
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
16
|
+
/* this file you indicate that you have read the license and */
|
17
|
+
/* understand and accept it fully. */
|
18
|
+
/* */
|
19
|
+
/***************************************************************************/
|
20
|
+
|
21
|
+
|
22
|
+
#ifndef __FT_SFNT_NAMES_H__
|
23
|
+
#define __FT_SFNT_NAMES_H__
|
24
|
+
|
25
|
+
|
26
|
+
#include <ft2build.h>
|
27
|
+
#include FT_FREETYPE_H
|
28
|
+
|
29
|
+
#ifdef FREETYPE_H
|
30
|
+
#error "freetype.h of FreeType 1 has been loaded!"
|
31
|
+
#error "Please fix the directory search order for header files"
|
32
|
+
#error "so that freetype.h of FreeType 2 is found first."
|
33
|
+
#endif
|
34
|
+
|
35
|
+
|
36
|
+
FT_BEGIN_HEADER
|
37
|
+
|
38
|
+
|
39
|
+
/*************************************************************************/
|
40
|
+
/* */
|
41
|
+
/* <Section> */
|
42
|
+
/* sfnt_names */
|
43
|
+
/* */
|
44
|
+
/* <Title> */
|
45
|
+
/* SFNT Names */
|
46
|
+
/* */
|
47
|
+
/* <Abstract> */
|
48
|
+
/* Access the names embedded in TrueType and OpenType files. */
|
49
|
+
/* */
|
50
|
+
/* <Description> */
|
51
|
+
/* The TrueType and OpenType specification allow the inclusion of */
|
52
|
+
/* a special `names table' in font files. This table contains */
|
53
|
+
/* textual (and internationalized) information regarding the font, */
|
54
|
+
/* like family name, copyright, version, etc. */
|
55
|
+
/* */
|
56
|
+
/* The definitions below are used to access them if available. */
|
57
|
+
/* */
|
58
|
+
/* Note that this has nothing to do with glyph names! */
|
59
|
+
/* */
|
60
|
+
/*************************************************************************/
|
61
|
+
|
62
|
+
|
63
|
+
/*************************************************************************/
|
64
|
+
/* */
|
65
|
+
/* <Struct> */
|
66
|
+
/* FT_SfntName */
|
67
|
+
/* */
|
68
|
+
/* <Description> */
|
69
|
+
/* A structure used to model an SFNT `name' table entry. */
|
70
|
+
/* */
|
71
|
+
/* <Fields> */
|
72
|
+
/* platform_id :: The platform ID for `string'. */
|
73
|
+
/* */
|
74
|
+
/* encoding_id :: The encoding ID for `string'. */
|
75
|
+
/* */
|
76
|
+
/* language_id :: The language ID for `string'. */
|
77
|
+
/* */
|
78
|
+
/* name_id :: An identifier for `string'. */
|
79
|
+
/* */
|
80
|
+
/* string :: The `name' string. Note that its format differs */
|
81
|
+
/* depending on the (platform,encoding) pair. It can */
|
82
|
+
/* be a Pascal String, a UTF-16 one, etc. */
|
83
|
+
/* */
|
84
|
+
/* Generally speaking, the string is not */
|
85
|
+
/* zero-terminated. Please refer to the TrueType */
|
86
|
+
/* specification for details. */
|
87
|
+
/* */
|
88
|
+
/* string_len :: The length of `string' in bytes. */
|
89
|
+
/* */
|
90
|
+
/* <Note> */
|
91
|
+
/* Possible values for `platform_id', `encoding_id', `language_id', */
|
92
|
+
/* and `name_id' are given in the file `ttnameid.h'. For details */
|
93
|
+
/* please refer to the TrueType or OpenType specification. */
|
94
|
+
/* */
|
95
|
+
/* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
|
96
|
+
/* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
|
97
|
+
/* */
|
98
|
+
typedef struct FT_SfntName_
|
99
|
+
{
|
100
|
+
FT_UShort platform_id;
|
101
|
+
FT_UShort encoding_id;
|
102
|
+
FT_UShort language_id;
|
103
|
+
FT_UShort name_id;
|
104
|
+
|
105
|
+
FT_Byte* string; /* this string is *not* null-terminated! */
|
106
|
+
FT_UInt string_len; /* in bytes */
|
107
|
+
|
108
|
+
} FT_SfntName;
|
109
|
+
|
110
|
+
|
111
|
+
/*************************************************************************/
|
112
|
+
/* */
|
113
|
+
/* <Function> */
|
114
|
+
/* FT_Get_Sfnt_Name_Count */
|
115
|
+
/* */
|
116
|
+
/* <Description> */
|
117
|
+
/* Retrieves the number of name strings in the SFNT `name' table. */
|
118
|
+
/* */
|
119
|
+
/* <Input> */
|
120
|
+
/* face :: A handle to the source face. */
|
121
|
+
/* */
|
122
|
+
/* <Return> */
|
123
|
+
/* The number of strings in the `name' table. */
|
124
|
+
/* */
|
125
|
+
FT_EXPORT( FT_UInt )
|
126
|
+
FT_Get_Sfnt_Name_Count( FT_Face face );
|
127
|
+
|
128
|
+
|
129
|
+
/*************************************************************************/
|
130
|
+
/* */
|
131
|
+
/* <Function> */
|
132
|
+
/* FT_Get_Sfnt_Name */
|
133
|
+
/* */
|
134
|
+
/* <Description> */
|
135
|
+
/* Retrieves a string of the SFNT `name' table for a given index. */
|
136
|
+
/* */
|
137
|
+
/* <Input> */
|
138
|
+
/* face :: A handle to the source face. */
|
139
|
+
/* */
|
140
|
+
/* idx :: The index of the `name' string. */
|
141
|
+
/* */
|
142
|
+
/* <Output> */
|
143
|
+
/* aname :: The indexed @FT_SfntName structure. */
|
144
|
+
/* */
|
145
|
+
/* <Return> */
|
146
|
+
/* FreeType error code. 0 means success. */
|
147
|
+
/* */
|
148
|
+
/* <Note> */
|
149
|
+
/* The `string' array returned in the `aname' structure is not */
|
150
|
+
/* null-terminated. */
|
151
|
+
/* */
|
152
|
+
/* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
|
153
|
+
/* `name' table entries, then do a loop until you get the right */
|
154
|
+
/* platform, encoding, and name ID. */
|
155
|
+
/* */
|
156
|
+
FT_EXPORT( FT_Error )
|
157
|
+
FT_Get_Sfnt_Name( FT_Face face,
|
158
|
+
FT_UInt idx,
|
159
|
+
FT_SfntName *aname );
|
160
|
+
|
161
|
+
|
162
|
+
/* */
|
163
|
+
|
164
|
+
|
165
|
+
FT_END_HEADER
|
166
|
+
|
167
|
+
#endif /* __FT_SFNT_NAMES_H__ */
|
168
|
+
|
169
|
+
|
170
|
+
/* END */
|
@@ -0,0 +1,716 @@
|
|
1
|
+
/***************************************************************************/
|
2
|
+
/* */
|
3
|
+
/* ftstroke.h */
|
4
|
+
/* */
|
5
|
+
/* FreeType path stroker (specification). */
|
6
|
+
/* */
|
7
|
+
/* Copyright 2002, 2003, 2004, 2005, 2006 by */
|
8
|
+
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
9
|
+
/* */
|
10
|
+
/* This file is part of the FreeType project, and may only be used, */
|
11
|
+
/* modified, and distributed under the terms of the FreeType project */
|
12
|
+
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
13
|
+
/* this file you indicate that you have read the license and */
|
14
|
+
/* understand and accept it fully. */
|
15
|
+
/* */
|
16
|
+
/***************************************************************************/
|
17
|
+
|
18
|
+
|
19
|
+
#ifndef __FT_STROKE_H__
|
20
|
+
#define __FT_STROKE_H__
|
21
|
+
|
22
|
+
#include <ft2build.h>
|
23
|
+
#include FT_OUTLINE_H
|
24
|
+
#include FT_GLYPH_H
|
25
|
+
|
26
|
+
|
27
|
+
FT_BEGIN_HEADER
|
28
|
+
|
29
|
+
|
30
|
+
/************************************************************************
|
31
|
+
*
|
32
|
+
* @section:
|
33
|
+
* glyph_stroker
|
34
|
+
*
|
35
|
+
* @title:
|
36
|
+
* Glyph Stroker
|
37
|
+
*
|
38
|
+
* @abstract:
|
39
|
+
* Generating bordered and stroked glyphs.
|
40
|
+
*
|
41
|
+
* @description:
|
42
|
+
* This component generates stroked outlines of a given vectorial
|
43
|
+
* glyph. It also allows you to retrieve the `outside' and/or the
|
44
|
+
* `inside' borders of the stroke.
|
45
|
+
*
|
46
|
+
* This can be useful to generate `bordered' glyph, i.e., glyphs
|
47
|
+
* displayed with a coloured (and anti-aliased) border around their
|
48
|
+
* shape.
|
49
|
+
*/
|
50
|
+
|
51
|
+
|
52
|
+
/**************************************************************
|
53
|
+
*
|
54
|
+
* @type:
|
55
|
+
* FT_Stroker
|
56
|
+
*
|
57
|
+
* @description:
|
58
|
+
* Opaque handler to a path stroker object.
|
59
|
+
*/
|
60
|
+
typedef struct FT_StrokerRec_* FT_Stroker;
|
61
|
+
|
62
|
+
|
63
|
+
/**************************************************************
|
64
|
+
*
|
65
|
+
* @enum:
|
66
|
+
* FT_Stroker_LineJoin
|
67
|
+
*
|
68
|
+
* @description:
|
69
|
+
* These values determine how two joining lines are rendered
|
70
|
+
* in a stroker.
|
71
|
+
*
|
72
|
+
* @values:
|
73
|
+
* FT_STROKER_LINEJOIN_ROUND ::
|
74
|
+
* Used to render rounded line joins. Circular arcs are used
|
75
|
+
* to join two lines smoothly.
|
76
|
+
*
|
77
|
+
* FT_STROKER_LINEJOIN_BEVEL ::
|
78
|
+
* Used to render beveled line joins; i.e., the two joining lines
|
79
|
+
* are extended until they intersect.
|
80
|
+
*
|
81
|
+
* FT_STROKER_LINEJOIN_MITER ::
|
82
|
+
* Same as beveled rendering, except that an additional line
|
83
|
+
* break is added if the angle between the two joining lines
|
84
|
+
* is too closed (this is useful to avoid unpleasant spikes
|
85
|
+
* in beveled rendering).
|
86
|
+
*/
|
87
|
+
typedef enum
|
88
|
+
{
|
89
|
+
FT_STROKER_LINEJOIN_ROUND = 0,
|
90
|
+
FT_STROKER_LINEJOIN_BEVEL,
|
91
|
+
FT_STROKER_LINEJOIN_MITER
|
92
|
+
|
93
|
+
} FT_Stroker_LineJoin;
|
94
|
+
|
95
|
+
|
96
|
+
/**************************************************************
|
97
|
+
*
|
98
|
+
* @enum:
|
99
|
+
* FT_Stroker_LineCap
|
100
|
+
*
|
101
|
+
* @description:
|
102
|
+
* These values determine how the end of opened sub-paths are
|
103
|
+
* rendered in a stroke.
|
104
|
+
*
|
105
|
+
* @values:
|
106
|
+
* FT_STROKER_LINECAP_BUTT ::
|
107
|
+
* The end of lines is rendered as a full stop on the last
|
108
|
+
* point itself.
|
109
|
+
*
|
110
|
+
* FT_STROKER_LINECAP_ROUND ::
|
111
|
+
* The end of lines is rendered as a half-circle around the
|
112
|
+
* last point.
|
113
|
+
*
|
114
|
+
* FT_STROKER_LINECAP_SQUARE ::
|
115
|
+
* The end of lines is rendered as a square around the
|
116
|
+
* last point.
|
117
|
+
*/
|
118
|
+
typedef enum
|
119
|
+
{
|
120
|
+
FT_STROKER_LINECAP_BUTT = 0,
|
121
|
+
FT_STROKER_LINECAP_ROUND,
|
122
|
+
FT_STROKER_LINECAP_SQUARE
|
123
|
+
|
124
|
+
} FT_Stroker_LineCap;
|
125
|
+
|
126
|
+
|
127
|
+
/**************************************************************
|
128
|
+
*
|
129
|
+
* @enum:
|
130
|
+
* FT_StrokerBorder
|
131
|
+
*
|
132
|
+
* @description:
|
133
|
+
* These values are used to select a given stroke border
|
134
|
+
* in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
|
135
|
+
*
|
136
|
+
* @values:
|
137
|
+
* FT_STROKER_BORDER_LEFT ::
|
138
|
+
* Select the left border, relative to the drawing direction.
|
139
|
+
*
|
140
|
+
* FT_STROKER_BORDER_RIGHT ::
|
141
|
+
* Select the right border, relative to the drawing direction.
|
142
|
+
*
|
143
|
+
* @note:
|
144
|
+
* Applications are generally interested in the `inside' and `outside'
|
145
|
+
* borders. However, there is no direct mapping between these and the
|
146
|
+
* `left' and `right' ones, since this really depends on the glyph's
|
147
|
+
* drawing orientation, which varies between font formats.
|
148
|
+
*
|
149
|
+
* You can however use @FT_Outline_GetInsideBorder and
|
150
|
+
* @FT_Outline_GetOutsideBorder to get these.
|
151
|
+
*/
|
152
|
+
typedef enum
|
153
|
+
{
|
154
|
+
FT_STROKER_BORDER_LEFT = 0,
|
155
|
+
FT_STROKER_BORDER_RIGHT
|
156
|
+
|
157
|
+
} FT_StrokerBorder;
|
158
|
+
|
159
|
+
|
160
|
+
/**************************************************************
|
161
|
+
*
|
162
|
+
* @function:
|
163
|
+
* FT_Outline_GetInsideBorder
|
164
|
+
*
|
165
|
+
* @description:
|
166
|
+
* Retrieve the @FT_StrokerBorder value corresponding to the
|
167
|
+
* `inside' borders of a given outline.
|
168
|
+
*
|
169
|
+
* @input:
|
170
|
+
* outline ::
|
171
|
+
* The source outline handle.
|
172
|
+
*
|
173
|
+
* @return:
|
174
|
+
* The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
|
175
|
+
* outlines.
|
176
|
+
*/
|
177
|
+
FT_EXPORT( FT_StrokerBorder )
|
178
|
+
FT_Outline_GetInsideBorder( FT_Outline* outline );
|
179
|
+
|
180
|
+
|
181
|
+
/**************************************************************
|
182
|
+
*
|
183
|
+
* @function:
|
184
|
+
* FT_Outline_GetOutsideBorder
|
185
|
+
*
|
186
|
+
* @description:
|
187
|
+
* Retrieve the @FT_StrokerBorder value corresponding to the
|
188
|
+
* `outside' borders of a given outline.
|
189
|
+
*
|
190
|
+
* @input:
|
191
|
+
* outline ::
|
192
|
+
* The source outline handle.
|
193
|
+
*
|
194
|
+
* @return:
|
195
|
+
* The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
|
196
|
+
* outlines.
|
197
|
+
*/
|
198
|
+
FT_EXPORT( FT_StrokerBorder )
|
199
|
+
FT_Outline_GetOutsideBorder( FT_Outline* outline );
|
200
|
+
|
201
|
+
|
202
|
+
/**************************************************************
|
203
|
+
*
|
204
|
+
* @function:
|
205
|
+
* FT_Stroker_New
|
206
|
+
*
|
207
|
+
* @description:
|
208
|
+
* Create a new stroker object.
|
209
|
+
*
|
210
|
+
* @input:
|
211
|
+
* library ::
|
212
|
+
* FreeType library handle.
|
213
|
+
*
|
214
|
+
* @output:
|
215
|
+
* astroker ::
|
216
|
+
* A new stroker object handle. NULL in case of error.
|
217
|
+
*
|
218
|
+
* @return:
|
219
|
+
* FreeType error code. 0 means success.
|
220
|
+
*/
|
221
|
+
FT_EXPORT( FT_Error )
|
222
|
+
FT_Stroker_New( FT_Library library,
|
223
|
+
FT_Stroker *astroker );
|
224
|
+
|
225
|
+
|
226
|
+
/**************************************************************
|
227
|
+
*
|
228
|
+
* @function:
|
229
|
+
* FT_Stroker_Set
|
230
|
+
*
|
231
|
+
* @description:
|
232
|
+
* Reset a stroker object's attributes.
|
233
|
+
*
|
234
|
+
* @input:
|
235
|
+
* stroker ::
|
236
|
+
* The target stroker handle.
|
237
|
+
*
|
238
|
+
* radius ::
|
239
|
+
* The border radius.
|
240
|
+
*
|
241
|
+
* line_cap ::
|
242
|
+
* The line cap style.
|
243
|
+
*
|
244
|
+
* line_join ::
|
245
|
+
* The line join style.
|
246
|
+
*
|
247
|
+
* miter_limit ::
|
248
|
+
* The miter limit for the FT_STROKER_LINEJOIN_MITER style,
|
249
|
+
* expressed as 16.16 fixed point value.
|
250
|
+
*
|
251
|
+
* @note:
|
252
|
+
* The radius is expressed in the same units that the outline
|
253
|
+
* coordinates.
|
254
|
+
*/
|
255
|
+
FT_EXPORT( void )
|
256
|
+
FT_Stroker_Set( FT_Stroker stroker,
|
257
|
+
FT_Fixed radius,
|
258
|
+
FT_Stroker_LineCap line_cap,
|
259
|
+
FT_Stroker_LineJoin line_join,
|
260
|
+
FT_Fixed miter_limit );
|
261
|
+
|
262
|
+
|
263
|
+
/**************************************************************
|
264
|
+
*
|
265
|
+
* @function:
|
266
|
+
* FT_Stroker_Rewind
|
267
|
+
*
|
268
|
+
* @description:
|
269
|
+
* Reset a stroker object without changing its attributes.
|
270
|
+
* You should call this function before beginning a new
|
271
|
+
* series of calls to @FT_Stroker_BeginSubPath or
|
272
|
+
* @FT_Stroker_EndSubPath.
|
273
|
+
*
|
274
|
+
* @input:
|
275
|
+
* stroker ::
|
276
|
+
* The target stroker handle.
|
277
|
+
*/
|
278
|
+
FT_EXPORT( void )
|
279
|
+
FT_Stroker_Rewind( FT_Stroker stroker );
|
280
|
+
|
281
|
+
|
282
|
+
/**************************************************************
|
283
|
+
*
|
284
|
+
* @function:
|
285
|
+
* FT_Stroker_ParseOutline
|
286
|
+
*
|
287
|
+
* @description:
|
288
|
+
* A convenience function used to parse a whole outline with
|
289
|
+
* the stroker. The resulting outline(s) can be retrieved
|
290
|
+
* later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
|
291
|
+
*
|
292
|
+
* @input:
|
293
|
+
* stroker ::
|
294
|
+
* The target stroker handle.
|
295
|
+
*
|
296
|
+
* outline ::
|
297
|
+
* The source outline.
|
298
|
+
*
|
299
|
+
* opened ::
|
300
|
+
* A boolean. If 1, the outline is treated as an open path instead
|
301
|
+
* of a closed one.
|
302
|
+
*
|
303
|
+
* @return:
|
304
|
+
* FreeType error code. 0 means success.
|
305
|
+
*
|
306
|
+
* @note:
|
307
|
+
* If `opened' is 0 (the default), the outline is treated as a closed
|
308
|
+
* path, and the stroker will generate two distinct `border' outlines.
|
309
|
+
*
|
310
|
+
* If `opened' is 1, the outline is processed as an open path, and the
|
311
|
+
* stroker will generate a single `stroke' outline.
|
312
|
+
*
|
313
|
+
* This function calls @FT_Stroker_Rewind automatically.
|
314
|
+
*/
|
315
|
+
FT_EXPORT( FT_Error )
|
316
|
+
FT_Stroker_ParseOutline( FT_Stroker stroker,
|
317
|
+
FT_Outline* outline,
|
318
|
+
FT_Bool opened );
|
319
|
+
|
320
|
+
|
321
|
+
/**************************************************************
|
322
|
+
*
|
323
|
+
* @function:
|
324
|
+
* FT_Stroker_BeginSubPath
|
325
|
+
*
|
326
|
+
* @description:
|
327
|
+
* Start a new sub-path in the stroker.
|
328
|
+
*
|
329
|
+
* @input:
|
330
|
+
* stroker ::
|
331
|
+
* The target stroker handle.
|
332
|
+
*
|
333
|
+
* to ::
|
334
|
+
* A pointer to the start vector.
|
335
|
+
*
|
336
|
+
* open ::
|
337
|
+
* A boolean. If 1, the sub-path is treated as an open one.
|
338
|
+
*
|
339
|
+
* @return:
|
340
|
+
* FreeType error code. 0 means success.
|
341
|
+
*
|
342
|
+
* @note:
|
343
|
+
* This function is useful when you need to stroke a path that is
|
344
|
+
* not stored as an @FT_Outline object.
|
345
|
+
*/
|
346
|
+
FT_EXPORT( FT_Error )
|
347
|
+
FT_Stroker_BeginSubPath( FT_Stroker stroker,
|
348
|
+
FT_Vector* to,
|
349
|
+
FT_Bool open );
|
350
|
+
|
351
|
+
|
352
|
+
/**************************************************************
|
353
|
+
*
|
354
|
+
* @function:
|
355
|
+
* FT_Stroker_EndSubPath
|
356
|
+
*
|
357
|
+
* @description:
|
358
|
+
* Close the current sub-path in the stroker.
|
359
|
+
*
|
360
|
+
* @input:
|
361
|
+
* stroker ::
|
362
|
+
* The target stroker handle.
|
363
|
+
*
|
364
|
+
* @return:
|
365
|
+
* FreeType error code. 0 means success.
|
366
|
+
*
|
367
|
+
* @note:
|
368
|
+
* You should call this function after @FT_Stroker_BeginSubPath.
|
369
|
+
* If the subpath was not `opened', this function will `draw' a
|
370
|
+
* single line segment to the start position when needed.
|
371
|
+
*/
|
372
|
+
FT_EXPORT( FT_Error )
|
373
|
+
FT_Stroker_EndSubPath( FT_Stroker stroker );
|
374
|
+
|
375
|
+
|
376
|
+
/**************************************************************
|
377
|
+
*
|
378
|
+
* @function:
|
379
|
+
* FT_Stroker_LineTo
|
380
|
+
*
|
381
|
+
* @description:
|
382
|
+
* `Draw' a single line segment in the stroker's current sub-path,
|
383
|
+
* from the last position.
|
384
|
+
*
|
385
|
+
* @input:
|
386
|
+
* stroker ::
|
387
|
+
* The target stroker handle.
|
388
|
+
*
|
389
|
+
* to ::
|
390
|
+
* A pointer to the destination point.
|
391
|
+
*
|
392
|
+
* @return:
|
393
|
+
* FreeType error code. 0 means success.
|
394
|
+
*
|
395
|
+
* @note:
|
396
|
+
* You should call this function between @FT_Stroker_BeginSubPath and
|
397
|
+
* @FT_Stroker_EndSubPath.
|
398
|
+
*/
|
399
|
+
FT_EXPORT( FT_Error )
|
400
|
+
FT_Stroker_LineTo( FT_Stroker stroker,
|
401
|
+
FT_Vector* to );
|
402
|
+
|
403
|
+
|
404
|
+
/**************************************************************
|
405
|
+
*
|
406
|
+
* @function:
|
407
|
+
* FT_Stroker_ConicTo
|
408
|
+
*
|
409
|
+
* @description:
|
410
|
+
* `Draw' a single quadratic Bézier in the stroker's current sub-path,
|
411
|
+
* from the last position.
|
412
|
+
*
|
413
|
+
* @input:
|
414
|
+
* stroker ::
|
415
|
+
* The target stroker handle.
|
416
|
+
*
|
417
|
+
* control ::
|
418
|
+
* A pointer to a Bézier control point.
|
419
|
+
*
|
420
|
+
* to ::
|
421
|
+
* A pointer to the destination point.
|
422
|
+
*
|
423
|
+
* @return:
|
424
|
+
* FreeType error code. 0 means success.
|
425
|
+
*
|
426
|
+
* @note:
|
427
|
+
* You should call this function between @FT_Stroker_BeginSubPath and
|
428
|
+
* @FT_Stroker_EndSubPath.
|
429
|
+
*/
|
430
|
+
FT_EXPORT( FT_Error )
|
431
|
+
FT_Stroker_ConicTo( FT_Stroker stroker,
|
432
|
+
FT_Vector* control,
|
433
|
+
FT_Vector* to );
|
434
|
+
|
435
|
+
|
436
|
+
/**************************************************************
|
437
|
+
*
|
438
|
+
* @function:
|
439
|
+
* FT_Stroker_CubicTo
|
440
|
+
*
|
441
|
+
* @description:
|
442
|
+
* `Draw' a single cubic Bézier in the stroker's current sub-path,
|
443
|
+
* from the last position.
|
444
|
+
*
|
445
|
+
* @input:
|
446
|
+
* stroker ::
|
447
|
+
* The target stroker handle.
|
448
|
+
*
|
449
|
+
* control1 ::
|
450
|
+
* A pointer to the first Bézier control point.
|
451
|
+
*
|
452
|
+
* control2 ::
|
453
|
+
* A pointer to second Bézier control point.
|
454
|
+
*
|
455
|
+
* to ::
|
456
|
+
* A pointer to the destination point.
|
457
|
+
*
|
458
|
+
* @return:
|
459
|
+
* FreeType error code. 0 means success.
|
460
|
+
*
|
461
|
+
* @note:
|
462
|
+
* You should call this function between @FT_Stroker_BeginSubPath and
|
463
|
+
* @FT_Stroker_EndSubPath.
|
464
|
+
*/
|
465
|
+
FT_EXPORT( FT_Error )
|
466
|
+
FT_Stroker_CubicTo( FT_Stroker stroker,
|
467
|
+
FT_Vector* control1,
|
468
|
+
FT_Vector* control2,
|
469
|
+
FT_Vector* to );
|
470
|
+
|
471
|
+
|
472
|
+
/**************************************************************
|
473
|
+
*
|
474
|
+
* @function:
|
475
|
+
* FT_Stroker_GetBorderCounts
|
476
|
+
*
|
477
|
+
* @description:
|
478
|
+
* Call this function once you have finished parsing your paths
|
479
|
+
* with the stroker. It will return the number of points and
|
480
|
+
* contours necessary to export one of the `border' or `stroke'
|
481
|
+
* outlines generated by the stroker.
|
482
|
+
*
|
483
|
+
* @input:
|
484
|
+
* stroker ::
|
485
|
+
* The target stroker handle.
|
486
|
+
*
|
487
|
+
* border ::
|
488
|
+
* The border index.
|
489
|
+
*
|
490
|
+
* @output:
|
491
|
+
* anum_points ::
|
492
|
+
* The number of points.
|
493
|
+
*
|
494
|
+
* anum_contours ::
|
495
|
+
* The number of contours.
|
496
|
+
*
|
497
|
+
* @return:
|
498
|
+
* FreeType error code. 0 means success.
|
499
|
+
*
|
500
|
+
* @note:
|
501
|
+
* When an outline, or a sub-path, is `closed', the stroker generates
|
502
|
+
* two independent `border' outlines, named `left' and `right'.
|
503
|
+
*
|
504
|
+
* When the outline, or a sub-path, is `opened', the stroker merges
|
505
|
+
* the `border' outlines with caps. The `left' border receives all
|
506
|
+
* points, while the `right' border becomes empty.
|
507
|
+
*
|
508
|
+
* Use the function @FT_Stroker_GetCounts instead if you want to
|
509
|
+
* retrieve the counts associated to both borders.
|
510
|
+
*/
|
511
|
+
FT_EXPORT( FT_Error )
|
512
|
+
FT_Stroker_GetBorderCounts( FT_Stroker stroker,
|
513
|
+
FT_StrokerBorder border,
|
514
|
+
FT_UInt *anum_points,
|
515
|
+
FT_UInt *anum_contours );
|
516
|
+
|
517
|
+
|
518
|
+
/**************************************************************
|
519
|
+
*
|
520
|
+
* @function:
|
521
|
+
* FT_Stroker_ExportBorder
|
522
|
+
*
|
523
|
+
* @description:
|
524
|
+
* Call this function after @FT_Stroker_GetBorderCounts to
|
525
|
+
* export the corresponding border to your own @FT_Outline
|
526
|
+
* structure.
|
527
|
+
*
|
528
|
+
* Note that this function will append the border points and
|
529
|
+
* contours to your outline, but will not try to resize its
|
530
|
+
* arrays.
|
531
|
+
*
|
532
|
+
* @input:
|
533
|
+
* stroker ::
|
534
|
+
* The target stroker handle.
|
535
|
+
*
|
536
|
+
* border ::
|
537
|
+
* The border index.
|
538
|
+
*
|
539
|
+
* outline ::
|
540
|
+
* The target outline handle.
|
541
|
+
*
|
542
|
+
* @note:
|
543
|
+
* Always call this function after @FT_Stroker_GetBorderCounts to
|
544
|
+
* get sure that there is enough room in your @FT_Outline object to
|
545
|
+
* receive all new data.
|
546
|
+
*
|
547
|
+
* When an outline, or a sub-path, is `closed', the stroker generates
|
548
|
+
* two independent `border' outlines, named `left' and `right'
|
549
|
+
*
|
550
|
+
* When the outline, or a sub-path, is `opened', the stroker merges
|
551
|
+
* the `border' outlines with caps. The `left' border receives all
|
552
|
+
* points, while the `right' border becomes empty.
|
553
|
+
*
|
554
|
+
* Use the function @FT_Stroker_Export instead if you want to
|
555
|
+
* retrieve all borders at once.
|
556
|
+
*/
|
557
|
+
FT_EXPORT( void )
|
558
|
+
FT_Stroker_ExportBorder( FT_Stroker stroker,
|
559
|
+
FT_StrokerBorder border,
|
560
|
+
FT_Outline* outline );
|
561
|
+
|
562
|
+
|
563
|
+
/**************************************************************
|
564
|
+
*
|
565
|
+
* @function:
|
566
|
+
* FT_Stroker_GetCounts
|
567
|
+
*
|
568
|
+
* @description:
|
569
|
+
* Call this function once you have finished parsing your paths
|
570
|
+
* with the stroker. It returns the number of points and
|
571
|
+
* contours necessary to export all points/borders from the stroked
|
572
|
+
* outline/path.
|
573
|
+
*
|
574
|
+
* @input:
|
575
|
+
* stroker ::
|
576
|
+
* The target stroker handle.
|
577
|
+
*
|
578
|
+
* @output:
|
579
|
+
* anum_points ::
|
580
|
+
* The number of points.
|
581
|
+
*
|
582
|
+
* anum_contours ::
|
583
|
+
* The number of contours.
|
584
|
+
*
|
585
|
+
* @return:
|
586
|
+
* FreeType error code. 0 means success.
|
587
|
+
*/
|
588
|
+
FT_EXPORT( FT_Error )
|
589
|
+
FT_Stroker_GetCounts( FT_Stroker stroker,
|
590
|
+
FT_UInt *anum_points,
|
591
|
+
FT_UInt *anum_contours );
|
592
|
+
|
593
|
+
|
594
|
+
/**************************************************************
|
595
|
+
*
|
596
|
+
* @function:
|
597
|
+
* FT_Stroker_Export
|
598
|
+
*
|
599
|
+
* @description:
|
600
|
+
* Call this function after @FT_Stroker_GetBorderCounts to
|
601
|
+
* export the all borders to your own @FT_Outline structure.
|
602
|
+
*
|
603
|
+
* Note that this function will append the border points and
|
604
|
+
* contours to your outline, but will not try to resize its
|
605
|
+
* arrays.
|
606
|
+
*
|
607
|
+
* @input:
|
608
|
+
* stroker ::
|
609
|
+
* The target stroker handle.
|
610
|
+
*
|
611
|
+
* outline ::
|
612
|
+
* The target outline handle.
|
613
|
+
*/
|
614
|
+
FT_EXPORT( void )
|
615
|
+
FT_Stroker_Export( FT_Stroker stroker,
|
616
|
+
FT_Outline* outline );
|
617
|
+
|
618
|
+
|
619
|
+
/**************************************************************
|
620
|
+
*
|
621
|
+
* @function:
|
622
|
+
* FT_Stroker_Done
|
623
|
+
*
|
624
|
+
* @description:
|
625
|
+
* Destroy a stroker object.
|
626
|
+
*
|
627
|
+
* @input:
|
628
|
+
* stroker ::
|
629
|
+
* A stroker handle. Can be NULL.
|
630
|
+
*/
|
631
|
+
FT_EXPORT( void )
|
632
|
+
FT_Stroker_Done( FT_Stroker stroker );
|
633
|
+
|
634
|
+
|
635
|
+
/**************************************************************
|
636
|
+
*
|
637
|
+
* @function:
|
638
|
+
* FT_Glyph_Stroke
|
639
|
+
*
|
640
|
+
* @description:
|
641
|
+
* Stroke a given outline glyph object with a given stroker.
|
642
|
+
*
|
643
|
+
* @inout:
|
644
|
+
* pglyph ::
|
645
|
+
* Source glyph handle on input, new glyph handle on output.
|
646
|
+
*
|
647
|
+
* @input:
|
648
|
+
* stroker ::
|
649
|
+
* A stroker handle.
|
650
|
+
*
|
651
|
+
* destroy ::
|
652
|
+
* A Boolean. If 1, the source glyph object is destroyed
|
653
|
+
* on success.
|
654
|
+
*
|
655
|
+
* @return:
|
656
|
+
* FreeType error code. 0 means success.
|
657
|
+
*
|
658
|
+
* @note:
|
659
|
+
* The source glyph is untouched in case of error.
|
660
|
+
*/
|
661
|
+
FT_EXPORT( FT_Error )
|
662
|
+
FT_Glyph_Stroke( FT_Glyph *pglyph,
|
663
|
+
FT_Stroker stroker,
|
664
|
+
FT_Bool destroy );
|
665
|
+
|
666
|
+
|
667
|
+
/**************************************************************
|
668
|
+
*
|
669
|
+
* @function:
|
670
|
+
* FT_Glyph_StrokeBorder
|
671
|
+
*
|
672
|
+
* @description:
|
673
|
+
* Stroke a given outline glyph object with a given stroker, but
|
674
|
+
* only return either its inside or outside border.
|
675
|
+
*
|
676
|
+
* @inout:
|
677
|
+
* pglyph ::
|
678
|
+
* Source glyph handle on input, new glyph handle on output.
|
679
|
+
*
|
680
|
+
* @input:
|
681
|
+
* stroker ::
|
682
|
+
* A stroker handle.
|
683
|
+
*
|
684
|
+
* inside ::
|
685
|
+
* A Boolean. If 1, return the inside border, otherwise
|
686
|
+
* the outside border.
|
687
|
+
*
|
688
|
+
* destroy ::
|
689
|
+
* A Boolean. If 1, the source glyph object is destroyed
|
690
|
+
* on success.
|
691
|
+
*
|
692
|
+
* @return:
|
693
|
+
* FreeType error code. 0 means success.
|
694
|
+
*
|
695
|
+
* @note:
|
696
|
+
* The source glyph is untouched in case of error.
|
697
|
+
*/
|
698
|
+
FT_EXPORT( FT_Error )
|
699
|
+
FT_Glyph_StrokeBorder( FT_Glyph *pglyph,
|
700
|
+
FT_Stroker stroker,
|
701
|
+
FT_Bool inside,
|
702
|
+
FT_Bool destroy );
|
703
|
+
|
704
|
+
/* */
|
705
|
+
|
706
|
+
FT_END_HEADER
|
707
|
+
|
708
|
+
#endif /* __FT_STROKE_H__ */
|
709
|
+
|
710
|
+
|
711
|
+
/* END */
|
712
|
+
|
713
|
+
|
714
|
+
/* Local Variables: */
|
715
|
+
/* coding: utf-8 */
|
716
|
+
/* End: */
|