ft-ffi 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/FTL.TXT +169 -0
- data/LICENSE.md +21 -0
- data/README.md +0 -0
- data/lib/freetype27.dll +0 -0
- data/lib/ft-ffi.rb +36 -0
- data/lib/ft-ffi/config.rb +79 -0
- data/lib/ft-ffi/constant/cff_hinting.rb +10 -0
- data/lib/ft-ffi/enum/auto_hinter_script.rb +12 -0
- data/lib/ft-ffi/enum/bdf_pcf/property_type.rb +12 -0
- data/lib/ft-ffi/enum/encoding.rb +19 -0
- data/lib/ft-ffi/enum/face_flag.rb +21 -0
- data/lib/ft-ffi/enum/gasp_table.rb +14 -0
- data/lib/ft-ffi/enum/glyph_bbox_mode.rb +10 -0
- data/lib/ft-ffi/enum/glyph_format.rb +12 -0
- data/lib/ft-ffi/enum/kerning_mode.rb +9 -0
- data/lib/ft-ffi/enum/lcd_filter.rb +16 -0
- data/lib/ft-ffi/enum/load_flag.rb +20 -0
- data/lib/ft-ffi/enum/module_bit_flag.rb +20 -0
- data/lib/ft-ffi/enum/open_args_flag.rb +13 -0
- data/lib/ft-ffi/enum/outline_flag.rb +21 -0
- data/lib/ft-ffi/enum/outline_orientation.rb +14 -0
- data/lib/ft-ffi/enum/pixel_mode.rb +17 -0
- data/lib/ft-ffi/enum/postscript/blend_flags.rb +25 -0
- data/lib/ft-ffi/enum/postscript/dict_keys.rb +62 -0
- data/lib/ft-ffi/enum/postscript/enconding_type.rb +13 -0
- data/lib/ft-ffi/enum/raster_params_flag.rb +12 -0
- data/lib/ft-ffi/enum/render_mode.rb +7 -0
- data/lib/ft-ffi/enum/sfnt_tag.rb +18 -0
- data/lib/ft-ffi/enum/size_request_type.rb +14 -0
- data/lib/ft-ffi/enum/slot_internal_flag.rb +5 -0
- data/lib/ft-ffi/enum/stroker_border.rb +10 -0
- data/lib/ft-ffi/enum/stroker_linecap.rb +11 -0
- data/lib/ft-ffi/enum/stroker_linejoin.rb +13 -0
- data/lib/ft-ffi/enum/style_flag.rb +11 -0
- data/lib/ft-ffi/enum/subglyph_flag.rb +16 -0
- data/lib/ft-ffi/enum/true_type/adobe_id.rb +13 -0
- data/lib/ft-ffi/enum/true_type/apple_id.rb +15 -0
- data/lib/ft-ffi/enum/true_type/iso_id.rb +12 -0
- data/lib/ft-ffi/enum/true_type/mac_id.rb +43 -0
- data/lib/ft-ffi/enum/true_type/ms_id.rb +17 -0
- data/lib/ft-ffi/enum/true_type/platform.rb +15 -0
- data/lib/ft-ffi/enum/true_type/true_type_engine_type.rb +11 -0
- data/lib/ft-ffi/enum/validate_open_type.rb +15 -0
- data/lib/ft-ffi/enum/validation_level.rb +11 -0
- data/lib/ft-ffi/enum/winfnt_id.rb +27 -0
- data/lib/ft-ffi/function/bitmap_handling.rb +39 -0
- data/lib/ft-ffi/function/cache.rb +132 -0
- data/lib/ft-ffi/function/char_map.rb +21 -0
- data/lib/ft-ffi/function/cid_fonts.rb +19 -0
- data/lib/ft-ffi/function/computation.rb +120 -0
- data/lib/ft-ffi/function/face.rb +218 -0
- data/lib/ft-ffi/function/font_formats.rb +11 -0
- data/lib/ft-ffi/function/glyph.rb +16 -0
- data/lib/ft-ffi/function/glyph_loader.rb +37 -0
- data/lib/ft-ffi/function/glyph_management.rb +40 -0
- data/lib/ft-ffi/function/glyph_slot.rb +41 -0
- data/lib/ft-ffi/function/glyph_stroker.rb +98 -0
- data/lib/ft-ffi/function/gzip.rb +20 -0
- data/lib/ft-ffi/function/lcd_filtering.rb +14 -0
- data/lib/ft-ffi/function/library.rb +11 -0
- data/lib/ft-ffi/function/list.rb +43 -0
- data/lib/ft-ffi/function/memory.rb +55 -0
- data/lib/ft-ffi/function/module_management.rb +98 -0
- data/lib/ft-ffi/function/multiple_master.rb +29 -0
- data/lib/ft-ffi/function/open_type.rb +18 -0
- data/lib/ft-ffi/function/outline.rb +87 -0
- data/lib/ft-ffi/function/pfr.rb +31 -0
- data/lib/ft-ffi/function/postscript.rb +30 -0
- data/lib/ft-ffi/function/resource_fork.rb +35 -0
- data/lib/ft-ffi/function/sfont.rb +19 -0
- data/lib/ft-ffi/function/size.rb +20 -0
- data/lib/ft-ffi/function/stream.rb +125 -0
- data/lib/ft-ffi/function/system.rb +11 -0
- data/lib/ft-ffi/function/true_type.rb +37 -0
- data/lib/ft-ffi/function/ttgx.rb +26 -0
- data/lib/ft-ffi/function/validator.rb +13 -0
- data/lib/ft-ffi/function/version.rb +20 -0
- data/lib/ft-ffi/function/win_fnt.rb +9 -0
- data/lib/ft-ffi/lib_base.rb +204 -0
- data/lib/ft-ffi/macro/basic_type.rb +19 -0
- data/lib/ft-ffi/macro/cache.rb +7 -0
- data/lib/ft-ffi/macro/error.rb +18 -0
- data/lib/ft-ffi/macro/module.rb +26 -0
- data/lib/ft-ffi/struct/bbox.rb +19 -0
- data/lib/ft-ffi/struct/bdf/property_rec.rb +15 -0
- data/lib/ft-ffi/struct/bitmap.rb +23 -0
- data/lib/ft-ffi/struct/bitmap_glyph_rec.rb +18 -0
- data/lib/ft-ffi/struct/bitmap_size.rb +17 -0
- data/lib/ft-ffi/struct/char_map_rec.rb +16 -0
- data/lib/ft-ffi/struct/cmap_class_rec.rb +32 -0
- data/lib/ft-ffi/struct/cmap_rec.rb +10 -0
- data/lib/ft-ffi/struct/data.rb +8 -0
- data/lib/ft-ffi/struct/driver_class_rec.rb +50 -0
- data/lib/ft-ffi/struct/driver_rec.rb +14 -0
- data/lib/ft-ffi/struct/face_internal_rec.rb +15 -0
- data/lib/ft-ffi/struct/face_rec.rb +67 -0
- data/lib/ft-ffi/struct/frame_field.rb +9 -0
- data/lib/ft-ffi/struct/ftc_image_type_rec.rb +11 -0
- data/lib/ft-ffi/struct/ftc_sbit_rec.rb +19 -0
- data/lib/ft-ffi/struct/ftc_scaler_rec.rb +12 -0
- data/lib/ft-ffi/struct/generic.rb +18 -0
- data/lib/ft-ffi/struct/glyph/glyph_class.rb +23 -0
- data/lib/ft-ffi/struct/glyph/glyph_load_rec.rb +13 -0
- data/lib/ft-ffi/struct/glyph/glyph_loader_rec.rb +17 -0
- data/lib/ft-ffi/struct/glyph/glyph_metrics.rb +23 -0
- data/lib/ft-ffi/struct/glyph/glyph_rec.rb +22 -0
- data/lib/ft-ffi/struct/glyph/glyph_slot_rec.rb +51 -0
- data/lib/ft-ffi/struct/incremental_funcs_rec.rb +15 -0
- data/lib/ft-ffi/struct/incremental_interface_rec.rb +8 -0
- data/lib/ft-ffi/struct/incremental_metrics_rec.rb +10 -0
- data/lib/ft-ffi/struct/library_rec.rb +34 -0
- data/lib/ft-ffi/struct/list_node_rec.rb +7 -0
- data/lib/ft-ffi/struct/list_rec.rb +22 -0
- data/lib/ft-ffi/struct/matrix.rb +17 -0
- data/lib/ft-ffi/struct/memory_rec.rb +15 -0
- data/lib/ft-ffi/struct/module_class.rb +26 -0
- data/lib/ft-ffi/struct/module_rec.rb +12 -0
- data/lib/ft-ffi/struct/multiple_masters/multi_master.rb +12 -0
- data/lib/ft-ffi/struct/multiple_masters/multiple_master_var.rb +13 -0
- data/lib/ft-ffi/struct/multiple_masters/multiple_masters_axis.rb +10 -0
- data/lib/ft-ffi/struct/multiple_masters/var_axis.rb +13 -0
- data/lib/ft-ffi/struct/multiple_masters/var_named_style.rb +9 -0
- data/lib/ft-ffi/struct/open_args.rb +17 -0
- data/lib/ft-ffi/struct/outline.rb +18 -0
- data/lib/ft-ffi/struct/outline_funcs.rb +26 -0
- data/lib/ft-ffi/struct/outline_glyph_rec.rb +17 -0
- data/lib/ft-ffi/struct/parameter.rb +12 -0
- data/lib/ft-ffi/struct/postscript/cid_face_dict_rect.rb +24 -0
- data/lib/ft-ffi/struct/postscript/cid_face_info_rec.rb +32 -0
- data/lib/ft-ffi/struct/postscript/font_info_rec.rb +16 -0
- data/lib/ft-ffi/struct/postscript/private_rec.rb +42 -0
- data/lib/ft-ffi/struct/prop_glyph_to_script_map.rb +8 -0
- data/lib/ft-ffi/struct/prop_increase_x_height.rb +8 -0
- data/lib/ft-ffi/struct/raster_funcs.rb +20 -0
- data/lib/ft-ffi/struct/raster_params.rb +28 -0
- data/lib/ft-ffi/struct/renderer_class.rb +27 -0
- data/lib/ft-ffi/struct/renderer_rec.rb +21 -0
- data/lib/ft-ffi/struct/service_cache_rec.rb +11 -0
- data/lib/ft-ffi/struct/service_desc_rec.rb +8 -0
- data/lib/ft-ffi/struct/sfnt_name.rb +14 -0
- data/lib/ft-ffi/struct/size_metrics.rb +18 -0
- data/lib/ft-ffi/struct/size_rec.rb +20 -0
- data/lib/ft-ffi/struct/size_request_rec.rb +11 -0
- data/lib/ft-ffi/struct/slot_internal_rec.rb +16 -0
- data/lib/ft-ffi/struct/span.rb +10 -0
- data/lib/ft-ffi/struct/stream_desc.rb +9 -0
- data/lib/ft-ffi/struct/stream_rec.rb +24 -0
- data/lib/ft-ffi/struct/stubs.rb +15 -0
- data/lib/ft-ffi/struct/sub_glyph_rec.rb +12 -0
- data/lib/ft-ffi/struct/true_type/header.rb +30 -0
- data/lib/ft-ffi/struct/true_type/hori_header.rb +28 -0
- data/lib/ft-ffi/struct/true_type/max_profile.rb +21 -0
- data/lib/ft-ffi/struct/true_type/os2.rb +53 -0
- data/lib/ft-ffi/struct/true_type/pclt.rb +21 -0
- data/lib/ft-ffi/struct/true_type/postscript.rb +16 -0
- data/lib/ft-ffi/struct/true_type/vert_header.rb +28 -0
- data/lib/ft-ffi/struct/unit_vector.rb +15 -0
- data/lib/ft-ffi/struct/validator_rec.rb +10 -0
- data/lib/ft-ffi/struct/vector.rb +15 -0
- data/lib/ft-ffi/struct/win_fnt_header_rec.rb +43 -0
- data/lib/ft-ffi/typedef/ftc_face_id.rb +6 -0
- data/lib/ft-ffi/version.rb +3 -0
- metadata +249 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 11796eafe482d26fd91deff6d719183d58644bce
|
4
|
+
data.tar.gz: 34f944ca743640fa9a82e56c757c5bbee84d25b3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c13522a01a285aaa8927a7d5e8fda52457db4155646b9096e34d580995ccf1db7500c70da93d049f1e67874603f6c778dbc37f1e8c9c3fb092bd7009949e046d
|
7
|
+
data.tar.gz: 6d9294a9a52bcef66c55da061b371f6b8715e0e7def512c499eed8b3b8c507678a747fcaa5fe27172e9a871197cc21f281a2f5b864c68a4437989a30fcb65e58
|
data/FTL.TXT
ADDED
@@ -0,0 +1,169 @@
|
|
1
|
+
The FreeType Project LICENSE
|
2
|
+
----------------------------
|
3
|
+
|
4
|
+
2006-Jan-27
|
5
|
+
|
6
|
+
Copyright 1996-2002, 2006 by
|
7
|
+
David Turner, Robert Wilhelm, and Werner Lemberg
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
Introduction
|
12
|
+
============
|
13
|
+
|
14
|
+
The FreeType Project is distributed in several archive packages;
|
15
|
+
some of them may contain, in addition to the FreeType font engine,
|
16
|
+
various tools and contributions which rely on, or relate to, the
|
17
|
+
FreeType Project.
|
18
|
+
|
19
|
+
This license applies to all files found in such packages, and
|
20
|
+
which do not fall under their own explicit license. The license
|
21
|
+
affects thus the FreeType font engine, the test programs,
|
22
|
+
documentation and makefiles, at the very least.
|
23
|
+
|
24
|
+
This license was inspired by the BSD, Artistic, and IJG
|
25
|
+
(Independent JPEG Group) licenses, which all encourage inclusion
|
26
|
+
and use of free software in commercial and freeware products
|
27
|
+
alike. As a consequence, its main points are that:
|
28
|
+
|
29
|
+
o We don't promise that this software works. However, we will be
|
30
|
+
interested in any kind of bug reports. (`as is' distribution)
|
31
|
+
|
32
|
+
o You can use this software for whatever you want, in parts or
|
33
|
+
full form, without having to pay us. (`royalty-free' usage)
|
34
|
+
|
35
|
+
o You may not pretend that you wrote this software. If you use
|
36
|
+
it, or only parts of it, in a program, you must acknowledge
|
37
|
+
somewhere in your documentation that you have used the
|
38
|
+
FreeType code. (`credits')
|
39
|
+
|
40
|
+
We specifically permit and encourage the inclusion of this
|
41
|
+
software, with or without modifications, in commercial products.
|
42
|
+
We disclaim all warranties covering The FreeType Project and
|
43
|
+
assume no liability related to The FreeType Project.
|
44
|
+
|
45
|
+
|
46
|
+
Finally, many people asked us for a preferred form for a
|
47
|
+
credit/disclaimer to use in compliance with this license. We thus
|
48
|
+
encourage you to use the following text:
|
49
|
+
|
50
|
+
"""
|
51
|
+
Portions of this software are copyright © <year> The FreeType
|
52
|
+
Project (www.freetype.org). All rights reserved.
|
53
|
+
"""
|
54
|
+
|
55
|
+
Please replace <year> with the value from the FreeType version you
|
56
|
+
actually use.
|
57
|
+
|
58
|
+
|
59
|
+
Legal Terms
|
60
|
+
===========
|
61
|
+
|
62
|
+
0. Definitions
|
63
|
+
--------------
|
64
|
+
|
65
|
+
Throughout this license, the terms `package', `FreeType Project',
|
66
|
+
and `FreeType archive' refer to the set of files originally
|
67
|
+
distributed by the authors (David Turner, Robert Wilhelm, and
|
68
|
+
Werner Lemberg) as the `FreeType Project', be they named as alpha,
|
69
|
+
beta or final release.
|
70
|
+
|
71
|
+
`You' refers to the licensee, or person using the project, where
|
72
|
+
`using' is a generic term including compiling the project's source
|
73
|
+
code as well as linking it to form a `program' or `executable'.
|
74
|
+
This program is referred to as `a program using the FreeType
|
75
|
+
engine'.
|
76
|
+
|
77
|
+
This license applies to all files distributed in the original
|
78
|
+
FreeType Project, including all source code, binaries and
|
79
|
+
documentation, unless otherwise stated in the file in its
|
80
|
+
original, unmodified form as distributed in the original archive.
|
81
|
+
If you are unsure whether or not a particular file is covered by
|
82
|
+
this license, you must contact us to verify this.
|
83
|
+
|
84
|
+
The FreeType Project is copyright (C) 1996-2000 by David Turner,
|
85
|
+
Robert Wilhelm, and Werner Lemberg. All rights reserved except as
|
86
|
+
specified below.
|
87
|
+
|
88
|
+
1. No Warranty
|
89
|
+
--------------
|
90
|
+
|
91
|
+
THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
|
92
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
93
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
94
|
+
PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
|
95
|
+
BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO
|
96
|
+
USE, OF THE FREETYPE PROJECT.
|
97
|
+
|
98
|
+
2. Redistribution
|
99
|
+
-----------------
|
100
|
+
|
101
|
+
This license grants a worldwide, royalty-free, perpetual and
|
102
|
+
irrevocable right and license to use, execute, perform, compile,
|
103
|
+
display, copy, create derivative works of, distribute and
|
104
|
+
sublicense the FreeType Project (in both source and object code
|
105
|
+
forms) and derivative works thereof for any purpose; and to
|
106
|
+
authorize others to exercise some or all of the rights granted
|
107
|
+
herein, subject to the following conditions:
|
108
|
+
|
109
|
+
o Redistribution of source code must retain this license file
|
110
|
+
(`FTL.TXT') unaltered; any additions, deletions or changes to
|
111
|
+
the original files must be clearly indicated in accompanying
|
112
|
+
documentation. The copyright notices of the unaltered,
|
113
|
+
original files must be preserved in all copies of source
|
114
|
+
files.
|
115
|
+
|
116
|
+
o Redistribution in binary form must provide a disclaimer that
|
117
|
+
states that the software is based in part of the work of the
|
118
|
+
FreeType Team, in the distribution documentation. We also
|
119
|
+
encourage you to put an URL to the FreeType web page in your
|
120
|
+
documentation, though this isn't mandatory.
|
121
|
+
|
122
|
+
These conditions apply to any software derived from or based on
|
123
|
+
the FreeType Project, not just the unmodified files. If you use
|
124
|
+
our work, you must acknowledge us. However, no fee need be paid
|
125
|
+
to us.
|
126
|
+
|
127
|
+
3. Advertising
|
128
|
+
--------------
|
129
|
+
|
130
|
+
Neither the FreeType authors and contributors nor you shall use
|
131
|
+
the name of the other for commercial, advertising, or promotional
|
132
|
+
purposes without specific prior written permission.
|
133
|
+
|
134
|
+
We suggest, but do not require, that you use one or more of the
|
135
|
+
following phrases to refer to this software in your documentation
|
136
|
+
or advertising materials: `FreeType Project', `FreeType Engine',
|
137
|
+
`FreeType library', or `FreeType Distribution'.
|
138
|
+
|
139
|
+
As you have not signed this license, you are not required to
|
140
|
+
accept it. However, as the FreeType Project is copyrighted
|
141
|
+
material, only this license, or another one contracted with the
|
142
|
+
authors, grants you the right to use, distribute, and modify it.
|
143
|
+
Therefore, by using, distributing, or modifying the FreeType
|
144
|
+
Project, you indicate that you understand and accept all the terms
|
145
|
+
of this license.
|
146
|
+
|
147
|
+
4. Contacts
|
148
|
+
-----------
|
149
|
+
|
150
|
+
There are two mailing lists related to FreeType:
|
151
|
+
|
152
|
+
o freetype@nongnu.org
|
153
|
+
|
154
|
+
Discusses general use and applications of FreeType, as well as
|
155
|
+
future and wanted additions to the library and distribution.
|
156
|
+
If you are looking for support, start in this list if you
|
157
|
+
haven't found anything to help you in the documentation.
|
158
|
+
|
159
|
+
o freetype-devel@nongnu.org
|
160
|
+
|
161
|
+
Discusses bugs, as well as engine internals, design issues,
|
162
|
+
specific licenses, porting, etc.
|
163
|
+
|
164
|
+
Our home page can be found at
|
165
|
+
|
166
|
+
http://www.freetype.org
|
167
|
+
|
168
|
+
|
169
|
+
--- end of FTL.TXT ---
|
data/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Pedro Miranda
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
File without changes
|
data/lib/freetype27.dll
ADDED
Binary file
|
data/lib/ft-ffi.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative 'ft-ffi/version'
|
2
|
+
require 'ffi-additions/struct'
|
3
|
+
require 'ft-ffi/config'
|
4
|
+
|
5
|
+
module FT
|
6
|
+
class FreeTypeError < StandardError; end
|
7
|
+
require_relative 'ft-ffi/lib_base'
|
8
|
+
|
9
|
+
extend LibBase
|
10
|
+
|
11
|
+
require 'ft-ffi/struct/stubs'
|
12
|
+
require 'ft-ffi/struct/library_rec'
|
13
|
+
require 'ft-ffi/struct/service_desc_rec'
|
14
|
+
require 'ft-ffi/struct/glyph/glyph_metrics'
|
15
|
+
|
16
|
+
if CONFIG_OPTION[:ENVIRONMENT_PROPERTIES]
|
17
|
+
# FT_Error ft_property_string_set(
|
18
|
+
# FT_Library library,
|
19
|
+
# const FT_String* module_name,
|
20
|
+
# const FT_String* property_name,
|
21
|
+
# FT_String* value );
|
22
|
+
attach_function 'property_string_set', 'ft_property_string_set', [LibraryRec.ptr, :string, :string, :string], :FT_Error
|
23
|
+
|
24
|
+
# FT_Pointer ft_service_list_lookup( FT_ServiceDesc service_descriptors, const char* service_id );
|
25
|
+
attach_function 'service_list_lookup', 'ft_service_list_lookup', [ServiceDescRec.ptr, :string], :FT_Pointer
|
26
|
+
|
27
|
+
# void ft_synthesize_vertical_metrics( FT_Glyph_Metrics* metrics, FT_Pos advance );
|
28
|
+
attach_function 'synthesize_vertical_metrics', 'ft_synthesize_vertical_metrics', [Glyph_Metrics.ptr, :FT_Pos], :void
|
29
|
+
end
|
30
|
+
|
31
|
+
# TODO use FT_Library_Version
|
32
|
+
# FREETYPE_MAJOR = 2
|
33
|
+
# FREETYPE_MINOR = 6
|
34
|
+
# FREETYPE_PATCH = 5
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
module FT
|
2
|
+
CONFIG_OPTION = {}
|
3
|
+
|
4
|
+
CONFIG_OPTION[:ENVIRONMENT_PROPERTIES] = true
|
5
|
+
CONFIG_OPTION[:SUBPIXEL_RENDERING] = false
|
6
|
+
CONFIG_OPTION[:FORCE_INT64] = false
|
7
|
+
CONFIG_OPTION[:INLINE_MULFIX] = true
|
8
|
+
CONFIG_OPTION[:USE_LZW] = true
|
9
|
+
CONFIG_OPTION[:USE_ZLIB] = true
|
10
|
+
CONFIG_OPTION[:SYSTEM_ZLIB] = false
|
11
|
+
CONFIG_OPTION[:USE_BZIP2] = false
|
12
|
+
CONFIG_OPTION[:DISABLE_STREAM_SUPPORT] = false
|
13
|
+
CONFIG_OPTION[:USE_PNG] = false
|
14
|
+
CONFIG_OPTION[:USE_HARFBUZZ] = false
|
15
|
+
CONFIG_OPTION[:POSTSCRIPT_NAMES] = true
|
16
|
+
CONFIG_OPTION[:ADOBE_GLYPH_LIST] = true
|
17
|
+
CONFIG_OPTION[:MAC_FONTS] = true
|
18
|
+
CONFIG_OPTION[:GUESSING_EMBEDDED_RFORK] = CONFIG_OPTION[:MAC_FONTS]
|
19
|
+
CONFIG_OPTION[:INCREMENTAL] = true
|
20
|
+
CONFIG_OPTION[:USE_MODULE_ERRORS] = false
|
21
|
+
CONFIG_OPTION[:PIC] = false
|
22
|
+
CONFIG_OPTION[:ENVIRONMENT_PROPERTIES] = true
|
23
|
+
CONFIG_OPTION[:NO_DEFAULT_SYSTEM] = false
|
24
|
+
|
25
|
+
RENDER_POOL_SIZE = 16384
|
26
|
+
|
27
|
+
# DEBUG_LEVEL = ERROR
|
28
|
+
# DEBUG_LEVEL = DEBUG
|
29
|
+
DEBUG_AUTOFIT = false
|
30
|
+
DEBUG_MEMORY = false
|
31
|
+
|
32
|
+
module TT
|
33
|
+
CONFIG_OPTION[:EMBEDDED_BITMAPS] = true
|
34
|
+
CONFIG_OPTION[:POSTSCRIPT_NAMES] = true
|
35
|
+
CONFIG_OPTION[:SFNT_NAMES] = true
|
36
|
+
CONFIG_OPTION[:BYTECODE_INTERPRETER] = true
|
37
|
+
CONFIG_OPTION[:COMPONENT_OFFSET_SCALED] = true
|
38
|
+
CONFIG_OPTION[:GX_VAR_SUPPORT] = true
|
39
|
+
CONFIG_OPTION[:BDF] = true
|
40
|
+
CONFIG_OPTION[:MAX_RUNNABLE_OPCODES] = 1000000
|
41
|
+
# CONFIG_OPTION[:SUBPIXEL_HINTING] = 1
|
42
|
+
# CONFIG_OPTION[:SUBPIXEL_HINTING] = 2
|
43
|
+
|
44
|
+
USE_BYTECODE_INTERPRETER = CONFIG_OPTION[:BYTECODE_INTERPRETER]
|
45
|
+
CONFIG_OPTION[:SUBPIXEL_HINTING_INFINALITY] = CONFIG_OPTION[:SUBPIXEL_HINTING] == 1
|
46
|
+
CONFIG_OPTION[:SUBPIXEL_HINTING_MINIMAL] = CONFIG_OPTION[:SUBPIXEL_HINTING] == 2
|
47
|
+
end
|
48
|
+
|
49
|
+
module T1
|
50
|
+
MAX_DICT_DEPTH = 5
|
51
|
+
MAX_SUBRS_CALLS = 16
|
52
|
+
MAX_CHARSTRINGS_OPERANDS = 256
|
53
|
+
CONFIG_OPTION[:NO_AFM] = false
|
54
|
+
CONFIG_OPTION[:NO_MM_SUPPORT] = false
|
55
|
+
end
|
56
|
+
|
57
|
+
module CFF
|
58
|
+
CONFIG_OPTION[:DARKENING_PARAMETER_X1] = 500
|
59
|
+
CONFIG_OPTION[:DARKENING_PARAMETER_Y1] = 400
|
60
|
+
|
61
|
+
CONFIG_OPTION[:DARKENING_PARAMETER_X2] = 1000
|
62
|
+
CONFIG_OPTION[:DARKENING_PARAMETER_Y2] = 275
|
63
|
+
|
64
|
+
CONFIG_OPTION[:DARKENING_PARAMETER_X3] = 1667
|
65
|
+
CONFIG_OPTION[:DARKENING_PARAMETER_Y3] = 275
|
66
|
+
|
67
|
+
CONFIG_OPTION[:DARKENING_PARAMETER_X4] = 2333
|
68
|
+
CONFIG_OPTION[:DARKENING_PARAMETER_Y4] = 0
|
69
|
+
|
70
|
+
CONFIG_OPTION[:OLD_ENGINE] = false
|
71
|
+
end
|
72
|
+
|
73
|
+
module AF
|
74
|
+
CONFIG_OPTION[:CJK] = true
|
75
|
+
CONFIG_OPTION[:INDIC] = true
|
76
|
+
CONFIG_OPTION[:USE_WARPER] = true
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'ft-ffi'
|
2
|
+
|
3
|
+
module FT
|
4
|
+
Encoding = enum :encoding, [
|
5
|
+
:MS_SYMBOL, 0x73796d62, #'symb'
|
6
|
+
:UNICODE, 0x756e6963, #'unic'
|
7
|
+
:SJIS, 0x736a6973, #'sjis'
|
8
|
+
:GB2312, 0x67622020, #'gb '
|
9
|
+
:BIG5, 0x62696735, #'big5'
|
10
|
+
:WANSUNG, 0x77616e73, #'wans'
|
11
|
+
:JOHAB, 0x6a6f6861, #'joha'
|
12
|
+
:ADOBE_STANDARD, 0x41444f42, #'ADOB'
|
13
|
+
:ADOBE_EXPERT, 0x41444245, #'ADBE'
|
14
|
+
:ADOBE_CUSTOM, 0x41444243, #'ADBC'
|
15
|
+
:ADOBE_LATIN_1, 0x6c617431, #'lat1'
|
16
|
+
:OLD_LATIN_2, 0x6c617432, #'lat2'
|
17
|
+
:APPLE_ROMAN, 0x61726d6e, #'armn'
|
18
|
+
]
|
19
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'ft-ffi'
|
2
|
+
|
3
|
+
module FT
|
4
|
+
# https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_FACE_FLAG_XXX
|
5
|
+
FaceFlag = enum :face_flag, [
|
6
|
+
:SCALABLE, 0x0001,
|
7
|
+
:FIXED_SIZES, 0x0002,
|
8
|
+
:FIXED_WIDTH, 0x0004,
|
9
|
+
:SFNT, 0x0008,
|
10
|
+
:HORIZONTAL, 0x0010,
|
11
|
+
:VERTICAL, 0x0020,
|
12
|
+
:KERNING, 0x0040,
|
13
|
+
:FAST_GLYPHS, 0x0080,
|
14
|
+
:MULTIPLE_MASTERS, 0x0100,
|
15
|
+
:GLYPH_NAMES, 0x0200,
|
16
|
+
:EXTERNAL_STREAM, 0x0400,
|
17
|
+
:HINTER, 0x0800,
|
18
|
+
:CID_KEYED, 0x1000,
|
19
|
+
:TRICKY, 0x2000
|
20
|
+
]
|
21
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'ft-ffi'
|
2
|
+
|
3
|
+
module FT
|
4
|
+
# https://www.freetype.org/freetype2/docs/reference/ft2-gasp_table.html#FT_GASP_XXX
|
5
|
+
GaspTable = enum :gasp_table, [
|
6
|
+
:NO_TABLE, -1,
|
7
|
+
:DO_GRIDFIT, 0x01,
|
8
|
+
:DO_GRAY, 0x02,
|
9
|
+
:SYMMETRIC_SMOOTHING, 0x08,
|
10
|
+
:SYMMETRIC_GRIDFIT, 0x10,
|
11
|
+
]
|
12
|
+
|
13
|
+
# define_prefix(:GASP, GaspTable)
|
14
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module FT
|
2
|
+
# https://www.freetype.org/freetype2/docs/reference/ft2-glyph_management.html#FT_Glyph_BBox_Mode
|
3
|
+
GlyphBBoxMode = enum :glyph_bbox_mode, [
|
4
|
+
:GLYPH_BBOX_UNSCALED, 0,
|
5
|
+
:GLYPH_BBOX_SUBPIXELS,0,
|
6
|
+
:GLYPH_BBOX_GRIDFIT, 1,
|
7
|
+
:GLYPH_BBOX_TRUNCATE, 2,
|
8
|
+
:GLYPH_BBOX_PIXELS, 3
|
9
|
+
]
|
10
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'ft-ffi'
|
2
|
+
|
3
|
+
module FT
|
4
|
+
# https://www.freetype.org/freetype2/docs/reference/ft2-basic_types.html#FT_Glyph_Format
|
5
|
+
GlyphFormat = enum :glyph_format, [
|
6
|
+
:NONE, 0,
|
7
|
+
:COMPOSITE, 0x636f6d70, #'comp'
|
8
|
+
:BITMAP, 0x62697473, #'bits'
|
9
|
+
:OUTLINE, 0x6f75746c, #'outl'
|
10
|
+
:PLOTTER, 0x706c6f74 #'plot'
|
11
|
+
]
|
12
|
+
end
|