pango 2.0.0-x86-mingw32 → 2.0.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/Rakefile +29 -3
  2. data/ext/pango/extconf.rb +7 -0
  3. data/ext/pango/rbpangocairo.c +12 -0
  4. data/ext/pango/rbpangofontmap.c +22 -3
  5. data/lib/1.9/pango.so +0 -0
  6. data/lib/2.0/pango.so +0 -0
  7. data/vendor/local/bin/hb-ot-shape-closure.exe +0 -0
  8. data/vendor/local/bin/hb-shape.exe +0 -0
  9. data/vendor/local/bin/hb-view.exe +0 -0
  10. data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
  11. data/vendor/local/bin/libharfbuzz-0.dll +0 -0
  12. data/vendor/local/bin/libpango-1.0-0.dll +0 -0
  13. data/vendor/local/bin/libpangocairo-1.0-0.dll +0 -0
  14. data/vendor/local/bin/libpangoft2-1.0-0.dll +0 -0
  15. data/vendor/local/bin/libpangowin32-1.0-0.dll +0 -0
  16. data/vendor/local/bin/libstdc++-6.dll +0 -0
  17. data/vendor/local/bin/pango-querymodules.exe +0 -0
  18. data/vendor/local/bin/pango-view.exe +0 -0
  19. data/vendor/local/etc/pango/pango.modules +1 -0
  20. data/vendor/local/include/harfbuzz/hb-blob.h +127 -0
  21. data/vendor/local/include/harfbuzz/hb-buffer.h +323 -0
  22. data/vendor/local/include/harfbuzz/hb-common.h +317 -0
  23. data/vendor/local/include/harfbuzz/hb-font.h +454 -0
  24. data/vendor/local/include/harfbuzz/hb-ft.h +62 -0
  25. data/vendor/local/include/harfbuzz/hb-glib.h +52 -0
  26. data/vendor/local/include/harfbuzz/hb-gobject.h +69 -0
  27. data/vendor/local/include/harfbuzz/hb-ot-layout.h +293 -0
  28. data/vendor/local/include/harfbuzz/hb-ot-tag.h +59 -0
  29. data/vendor/local/include/harfbuzz/hb-ot.h +49 -0
  30. data/vendor/local/include/harfbuzz/hb-set.h +152 -0
  31. data/vendor/local/include/harfbuzz/hb-shape-plan.h +89 -0
  32. data/vendor/local/include/harfbuzz/hb-shape.h +81 -0
  33. data/vendor/local/include/harfbuzz/hb-unicode.h +357 -0
  34. data/vendor/local/include/harfbuzz/hb-uniscribe.h +49 -0
  35. data/vendor/local/include/harfbuzz/hb-version.h +66 -0
  36. data/vendor/local/include/harfbuzz/hb.h +45 -0
  37. data/vendor/local/include/pango-1.0/pango/pango-attributes.h +2 -2
  38. data/vendor/local/include/pango-1.0/pango/pango-features.h +2 -2
  39. data/vendor/local/include/pango-1.0/pango/pango-ot.h +242 -0
  40. data/vendor/local/include/pango-1.0/pango/pangofc-decoder.h +110 -0
  41. data/vendor/local/include/pango-1.0/pango/pangofc-font.h +153 -0
  42. data/vendor/local/include/pango-1.0/pango/pangofc-fontmap.h +289 -0
  43. data/vendor/local/include/pango-1.0/pango/pangoft2.h +120 -0
  44. data/vendor/local/lib/girepository-1.0/PangoCairo-1.0.typelib +0 -0
  45. data/vendor/local/lib/girepository-1.0/PangoFT2-1.0.typelib +0 -0
  46. data/vendor/local/lib/libharfbuzz.dll.a +0 -0
  47. data/vendor/local/lib/libharfbuzz.la +41 -0
  48. data/vendor/local/lib/libpango-1.0.dll.a +0 -0
  49. data/vendor/local/lib/libpango-1.0.la +1 -1
  50. data/vendor/local/lib/libpangocairo-1.0.dll.a +0 -0
  51. data/vendor/local/lib/libpangocairo-1.0.la +2 -2
  52. data/vendor/local/lib/libpangoft2-1.0.dll.a +0 -0
  53. data/vendor/local/lib/libpangoft2-1.0.la +41 -0
  54. data/vendor/local/lib/libpangowin32-1.0.dll.a +0 -0
  55. data/vendor/local/lib/libpangowin32-1.0.la +1 -1
  56. data/vendor/local/lib/pango/1.8.0/modules/pango-arabic-lang.dll +0 -0
  57. data/vendor/local/lib/pango/1.8.0/modules/pango-arabic-lang.dll.a +0 -0
  58. data/vendor/local/lib/pango/1.8.0/modules/pango-basic-fc.dll +0 -0
  59. data/vendor/local/lib/pango/1.8.0/modules/pango-basic-fc.dll.a +0 -0
  60. data/vendor/local/lib/pango/1.8.0/modules/pango-basic-fc.la +41 -0
  61. data/vendor/local/lib/pango/1.8.0/modules/pango-basic-win32.dll +0 -0
  62. data/vendor/local/lib/pango/1.8.0/modules/pango-basic-win32.dll.a +0 -0
  63. data/vendor/local/lib/pango/1.8.0/modules/pango-indic-lang.dll +0 -0
  64. data/vendor/local/lib/pango/1.8.0/modules/pango-indic-lang.dll.a +0 -0
  65. data/vendor/local/lib/pkgconfig/harfbuzz.pc +11 -0
  66. data/vendor/local/lib/pkgconfig/pango.pc +1 -1
  67. data/vendor/local/lib/pkgconfig/pangocairo.pc +2 -2
  68. data/vendor/local/lib/pkgconfig/pangoft2.pc +12 -0
  69. data/vendor/local/lib/pkgconfig/pangowin32.pc +1 -1
  70. data/vendor/local/share/gir-1.0/Pango-1.0.gir +1 -1
  71. data/vendor/local/share/gir-1.0/PangoCairo-1.0.gir +22 -1
  72. data/vendor/local/share/gir-1.0/PangoFT2-1.0.gir +349 -0
  73. data/vendor/local/share/gtk-doc/html/pango/PangoEngineLang.html +5 -5
  74. data/vendor/local/share/gtk-doc/html/pango/PangoEngineShape.html +4 -4
  75. data/vendor/local/share/gtk-doc/html/pango/PangoFcDecoder.html +3 -3
  76. data/vendor/local/share/gtk-doc/html/pango/PangoFcFont.html +17 -17
  77. data/vendor/local/share/gtk-doc/html/pango/PangoFcFontMap.html +22 -22
  78. data/vendor/local/share/gtk-doc/html/pango/index.html +1 -1
  79. data/vendor/local/share/gtk-doc/html/pango/pango-Bidirectional-Text.html +15 -15
  80. data/vendor/local/share/gtk-doc/html/pango/pango-Cairo-Rendering.html +30 -30
  81. data/vendor/local/share/gtk-doc/html/pango/pango-CoreText-Fonts.html +1 -1
  82. data/vendor/local/share/gtk-doc/html/pango/pango-Coverage-Maps.html +7 -7
  83. data/vendor/local/share/gtk-doc/html/pango/pango-Engines.html +11 -11
  84. data/vendor/local/share/gtk-doc/html/pango/pango-Fonts.html +123 -123
  85. data/vendor/local/share/gtk-doc/html/pango/pango-FreeType-Fonts-and-Rendering.html +15 -15
  86. data/vendor/local/share/gtk-doc/html/pango/pango-Glyph-Storage.html +56 -56
  87. data/vendor/local/share/gtk-doc/html/pango/pango-Layout-Objects.html +130 -130
  88. data/vendor/local/share/gtk-doc/html/pango/pango-Miscellaneous-Utilities.html +76 -76
  89. data/vendor/local/share/gtk-doc/html/pango/pango-Modules.html +9 -9
  90. data/vendor/local/share/gtk-doc/html/pango/pango-OpenType-Font-Handling.html +101 -101
  91. data/vendor/local/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html +38 -38
  92. data/vendor/local/share/gtk-doc/html/pango/pango-Tab-Stops.html +35 -35
  93. data/vendor/local/share/gtk-doc/html/pango/pango-Text-Attributes.html +135 -135
  94. data/vendor/local/share/gtk-doc/html/pango/pango-Text-Processing.html +75 -75
  95. data/vendor/local/share/gtk-doc/html/pango/pango-Version-Checking.html +3 -3
  96. data/vendor/local/share/gtk-doc/html/pango/pango-Vertical-Text.html +8 -8
  97. data/vendor/local/share/gtk-doc/html/pango/pango-Win32-Fonts-and-Rendering.html +22 -22
  98. data/vendor/local/share/gtk-doc/html/pango/pango-Xft-Fonts-and-Rendering.html +35 -35
  99. data/vendor/local/share/gtk-doc/html/pango/pango-hierarchy.html +1 -1
  100. data/vendor/local/share/gtk-doc/html/pango/pango-pango-renderer.html +11 -11
  101. data/vendor/local/share/license/harfbuzz/AUTHORS +8 -0
  102. data/vendor/local/share/license/harfbuzz/COPYING +36 -0
  103. data/vendor/local/share/man/man1/pango-querymodules.1 +2 -2
  104. data/vendor/local/share/man/man1/pango-view.1 +1 -1
  105. metadata +50 -8
data/Rakefile CHANGED
@@ -6,24 +6,50 @@ require "gnome2/rake/package-task"
6
6
  package_task = GNOME2::Rake::PackageTask.new do |package|
7
7
  package.summary = "Ruby/Pango is a Ruby binding of pango-1.x."
8
8
  package.description = "Ruby/Pango is a Ruby binding of pango-1.x."
9
- package.dependency.gem.runtime = [["cairo", ">= 1.10.0"], "glib2"]
9
+ package.dependency.gem.runtime = [["cairo", ">= 1.12.5"], "glib2"]
10
10
  package.windows.packages = []
11
11
  package.windows.dependencies = []
12
12
  package.windows.build_dependencies = ["glib2", "gobject-introspection"]
13
13
  package.external_packages = [
14
+ {
15
+ :name => "harfbuzz",
16
+ :download_base_url => "http://www.freedesktop.org/software/harfbuzz/release",
17
+ :label => "HarfBuzz",
18
+ :version => "0.9.17",
19
+ :compression_method => "bz2",
20
+ },
14
21
  {
15
22
  :name => "pango",
16
23
  :download_site => :gnome,
17
24
  :label => "pango",
18
- :version => "1.34.0",
25
+ :version => "1.34.1",
19
26
  :compression_method => "xz",
20
27
  :windows => {
21
28
  :configure_args => [
22
29
  "--enable-introspection",
23
30
  ],
31
+ :patches => [
32
+ "pango-1.34.0-enable-fc-font.diff",
33
+ ],
24
34
  },
25
- }
35
+ },
26
36
  ]
27
37
  end
28
38
  package_task.define
29
39
 
40
+ namespace :gcc do
41
+ namespace :dll do
42
+ desc "Bundle GCC related DLLs"
43
+ task(:bundle) do
44
+ dlls = ["libgcc_s_sjlj-1.dll", "libstdc++-6.dll"]
45
+ dlls.each do |dll|
46
+ host = package_task.windows.build_host
47
+ binary_dir = package_task.windows.absolute_binary_dir
48
+ full_path = `#{host}-g++ -print-file-name=#{dll}`.strip
49
+ cp(full_path, (binary_dir + "bin").to_s)
50
+ end
51
+ end
52
+ end
53
+ end
54
+
55
+ task "win32:builder:build:harfbuzz:after" => "gcc:dll:bundle"
data/ext/pango/extconf.rb CHANGED
@@ -67,6 +67,13 @@ unless required_pkg_config_package(package_id,
67
67
  end
68
68
  PKGConfig.have_package('pangocairo')
69
69
 
70
+ if PKGConfig.have_package("pangowin32")
71
+ $defs << " -DHAVE_PANGO_WIN32"
72
+ end
73
+ if PKGConfig.have_package("pangoft2")
74
+ $defs << " -DHAVE_PANGO_FT2"
75
+ end
76
+
70
77
  pango_header = "pango/pango.h"
71
78
  have_func("pango_layout_iter_get_type", pango_header)
72
79
  have_func("pango_layout_set_ellipsize", pango_header)
@@ -39,6 +39,15 @@ rg_s_default(G_GNUC_UNUSED VALUE klass)
39
39
  return GOBJ2RVAL(pango_cairo_font_map_get_default());
40
40
  }
41
41
 
42
+ # if PANGO_CHECK_VERSION(1, 22, 0)
43
+ static VALUE
44
+ rg_s_set_default(VALUE klass, VALUE font_map)
45
+ {
46
+ pango_cairo_font_map_set_default(RVAL2GOBJ(font_map));
47
+ return klass;
48
+ }
49
+ # endif
50
+
42
51
  static VALUE
43
52
  rg_set_resolution(VALUE self, VALUE dpi)
44
53
  {
@@ -71,6 +80,9 @@ Init_pango_cairo(VALUE mPango)
71
80
 
72
81
  RG_DEF_SMETHOD(create, 0);
73
82
  RG_DEF_SMETHOD(default, 0);
83
+ # if PANGO_CHECK_VERSION(1, 22, 0)
84
+ RG_DEF_SMETHOD(set_default, 1);
85
+ # endif
74
86
 
75
87
  RG_DEF_METHOD(set_resolution, 1);
76
88
  RG_DEF_METHOD(resolution, 0);
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
4
4
  * Copyright (C) 2002-2005 Masao Mutoh
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -24,6 +24,18 @@
24
24
  #define RG_TARGET_NAMESPACE cFontMap
25
25
  #define _SELF(self) (RVAL2PANGOFONTMAP(self))
26
26
 
27
+ #ifdef CAIRO_AVAILABLE
28
+ # ifdef HAVE_PANGO_FT2
29
+ # define PANGO_TYPE_CAIRO_FC_FONT_MAP \
30
+ (pango_cairo_fc_font_map_get_type())
31
+ # endif
32
+
33
+ # ifdef HAVE_PANGO_WIN32
34
+ # define PANGO_TYPE_CAIRO_WIN32_FONT_MAP \
35
+ (pango_cairo_win32_font_map_get_type())
36
+ # endif
37
+ #endif
38
+
27
39
  /*
28
40
  static VALUE
29
41
  rg_initialize(VALUE self)
@@ -99,9 +111,16 @@ Init_pango_font_map(VALUE mPango)
99
111
  G_DEF_CLASS3("PangoFT2FontMap", "FT2FontMap", mPango);
100
112
  G_DEF_CLASS3("PangoXFontMap", "XFontMap", mPango);
101
113
  G_DEF_CLASS3("PangoWin32FontMap", "Win32FontMap", mPango);
114
+ G_DEF_CLASS3("PangoCoreTextFontMap", "CoreTextFontMap", mPango);
115
+ #ifdef PANGO_TYPE_CAIRO_FC_FONT_MAP
116
+ G_DEF_CLASS(PANGO_TYPE_CAIRO_FC_FONT_MAP, "CairoFcFontMap", mPango);
117
+ #else
102
118
  G_DEF_CLASS3("PangoCairoFcFontMap", "CairoFcFontMap", mPango);
119
+ #endif
120
+ #ifdef PANGO_TYPE_CAIRO_WIN32_FONT_MAP
121
+ G_DEF_CLASS(PANGO_TYPE_CAIRO_WIN32_FONT_MAP, "CairoWin32FontMap", mPango);
122
+ #else
103
123
  G_DEF_CLASS3("PangoCairoWin32FontMap", "CairoWin32FontMap", mPango);
104
- #if PANGO_CHECK_VERSION(1,12,0)
105
- G_DEF_CLASS3("PangoATSUIFontMap", "ATSUIFontMap", mPango);
106
124
  #endif
125
+ G_DEF_CLASS3("PangoCairoCoreTextFontMap", "CairoCoreTextFontMap", mPango);
107
126
  }
data/lib/1.9/pango.so CHANGED
Binary file
data/lib/2.0/pango.so CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -15,4 +15,5 @@
15
15
  /home/kou/work/ruby/ruby-gnome2.win32/pango/vendor/local/lib/pango/1.8.0/modules/pango-indic-lang.dll sinhIndicScriptEngineLang PangoEngineLang PangoRenderNone sinhala:*
16
16
  /home/kou/work/ruby/ruby-gnome2.win32/pango/vendor/local/lib/pango/1.8.0/modules/pango-arabic-lang.dll ArabicScriptEngineLang PangoEngineLang PangoRenderNone arabic:*
17
17
  /home/kou/work/ruby/ruby-gnome2.win32/pango/vendor/local/lib/pango/1.8.0/modules/pango-basic-win32.dll BasicScriptEngineWin32 PangoEngineShape PangoRenderWin32 common:
18
+ /home/kou/work/ruby/ruby-gnome2.win32/pango/vendor/local/lib/pango/1.8.0/modules/pango-basic-fc.dll BasicScriptEngineFc PangoEngineShape PangoRenderFc common:
18
19
 
@@ -0,0 +1,127 @@
1
+ /*
2
+ * Copyright © 2009 Red Hat, Inc.
3
+ *
4
+ * This is part of HarfBuzz, a text shaping library.
5
+ *
6
+ * Permission is hereby granted, without written agreement and without
7
+ * license or royalty fees, to use, copy, modify, and distribute this
8
+ * software and its documentation for any purpose, provided that the
9
+ * above copyright notice and the following two paragraphs appear in
10
+ * all copies of this software.
11
+ *
12
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
16
+ * DAMAGE.
17
+ *
18
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20
+ * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23
+ *
24
+ * Red Hat Author(s): Behdad Esfahbod
25
+ */
26
+
27
+ #ifndef HB_H_IN
28
+ #error "Include <hb.h> instead."
29
+ #endif
30
+
31
+ #ifndef HB_BLOB_H
32
+ #define HB_BLOB_H
33
+
34
+ #include "hb-common.h"
35
+
36
+ HB_BEGIN_DECLS
37
+
38
+
39
+ /*
40
+ * Note re various memory-modes:
41
+ *
42
+ * - In no case shall the HarfBuzz client modify memory
43
+ * that is passed to HarfBuzz in a blob. If there is
44
+ * any such possibility, MODE_DUPLICATE should be used
45
+ * such that HarfBuzz makes a copy immediately,
46
+ *
47
+ * - Use MODE_READONLY otherse, unless you really really
48
+ * really know what you are doing,
49
+ *
50
+ * - MODE_WRITABLE is appropriate if you relaly made a
51
+ * copy of data solely for the purpose of passing to
52
+ * HarfBuzz and doing that just once (no reuse!),
53
+ *
54
+ * - If the font is mmap()ed, it's ok to use
55
+ * READONLY_MAY_MAKE_WRITABLE, however, there were
56
+ * design problems with that mode, so HarfBuzz do not
57
+ * really use it anymore. If not sure, use MODE_READONLY.
58
+ */
59
+ typedef enum {
60
+ HB_MEMORY_MODE_DUPLICATE,
61
+ HB_MEMORY_MODE_READONLY,
62
+ HB_MEMORY_MODE_WRITABLE,
63
+ HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE
64
+ } hb_memory_mode_t;
65
+
66
+ typedef struct hb_blob_t hb_blob_t;
67
+
68
+ hb_blob_t *
69
+ hb_blob_create (const char *data,
70
+ unsigned int length,
71
+ hb_memory_mode_t mode,
72
+ void *user_data,
73
+ hb_destroy_func_t destroy);
74
+
75
+ /* Always creates with MEMORY_MODE_READONLY.
76
+ * Even if the parent blob is writable, we don't
77
+ * want the user of the sub-blob to be able to
78
+ * modify the parent data as that data may be
79
+ * shared among multiple sub-blobs.
80
+ */
81
+ hb_blob_t *
82
+ hb_blob_create_sub_blob (hb_blob_t *parent,
83
+ unsigned int offset,
84
+ unsigned int length);
85
+
86
+ hb_blob_t *
87
+ hb_blob_get_empty (void);
88
+
89
+ hb_blob_t *
90
+ hb_blob_reference (hb_blob_t *blob);
91
+
92
+ void
93
+ hb_blob_destroy (hb_blob_t *blob);
94
+
95
+ hb_bool_t
96
+ hb_blob_set_user_data (hb_blob_t *blob,
97
+ hb_user_data_key_t *key,
98
+ void * data,
99
+ hb_destroy_func_t destroy,
100
+ hb_bool_t replace);
101
+
102
+
103
+ void *
104
+ hb_blob_get_user_data (hb_blob_t *blob,
105
+ hb_user_data_key_t *key);
106
+
107
+
108
+ void
109
+ hb_blob_make_immutable (hb_blob_t *blob);
110
+
111
+ hb_bool_t
112
+ hb_blob_is_immutable (hb_blob_t *blob);
113
+
114
+
115
+ unsigned int
116
+ hb_blob_get_length (hb_blob_t *blob);
117
+
118
+ const char *
119
+ hb_blob_get_data (hb_blob_t *blob, unsigned int *length);
120
+
121
+ char *
122
+ hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length);
123
+
124
+
125
+ HB_END_DECLS
126
+
127
+ #endif /* HB_BLOB_H */
@@ -0,0 +1,323 @@
1
+ /*
2
+ * Copyright © 1998-2004 David Turner and Werner Lemberg
3
+ * Copyright © 2004,2007,2009 Red Hat, Inc.
4
+ * Copyright © 2011,2012 Google, Inc.
5
+ *
6
+ * This is part of HarfBuzz, a text shaping library.
7
+ *
8
+ * Permission is hereby granted, without written agreement and without
9
+ * license or royalty fees, to use, copy, modify, and distribute this
10
+ * software and its documentation for any purpose, provided that the
11
+ * above copyright notice and the following two paragraphs appear in
12
+ * all copies of this software.
13
+ *
14
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
15
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
16
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
17
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18
+ * DAMAGE.
19
+ *
20
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
21
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
22
+ * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
23
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
24
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25
+ *
26
+ * Red Hat Author(s): Owen Taylor, Behdad Esfahbod
27
+ * Google Author(s): Behdad Esfahbod
28
+ */
29
+
30
+ #ifndef HB_H_IN
31
+ #error "Include <hb.h> instead."
32
+ #endif
33
+
34
+ #ifndef HB_BUFFER_H
35
+ #define HB_BUFFER_H
36
+
37
+ #include "hb-common.h"
38
+ #include "hb-unicode.h"
39
+ #include "hb-font.h"
40
+
41
+ HB_BEGIN_DECLS
42
+
43
+
44
+ typedef struct hb_glyph_info_t {
45
+ hb_codepoint_t codepoint;
46
+ hb_mask_t mask;
47
+ uint32_t cluster;
48
+
49
+ /*< private >*/
50
+ hb_var_int_t var1;
51
+ hb_var_int_t var2;
52
+ } hb_glyph_info_t;
53
+
54
+ typedef struct hb_glyph_position_t {
55
+ hb_position_t x_advance;
56
+ hb_position_t y_advance;
57
+ hb_position_t x_offset;
58
+ hb_position_t y_offset;
59
+
60
+ /*< private >*/
61
+ hb_var_int_t var;
62
+ } hb_glyph_position_t;
63
+
64
+
65
+ typedef struct hb_segment_properties_t {
66
+ hb_direction_t direction;
67
+ hb_script_t script;
68
+ hb_language_t language;
69
+ /*< private >*/
70
+ void *reserved1;
71
+ void *reserved2;
72
+ } hb_segment_properties_t;
73
+
74
+ #define HB_SEGMENT_PROPERTIES_DEFAULT {HB_DIRECTION_INVALID, \
75
+ HB_SCRIPT_INVALID, \
76
+ HB_LANGUAGE_INVALID, \
77
+ NULL, \
78
+ NULL}
79
+
80
+ hb_bool_t
81
+ hb_segment_properties_equal (const hb_segment_properties_t *a,
82
+ const hb_segment_properties_t *b);
83
+
84
+ unsigned int
85
+ hb_segment_properties_hash (const hb_segment_properties_t *p);
86
+
87
+
88
+
89
+ /*
90
+ * hb_buffer_t
91
+ */
92
+
93
+ typedef struct hb_buffer_t hb_buffer_t;
94
+
95
+ hb_buffer_t *
96
+ hb_buffer_create (void);
97
+
98
+ hb_buffer_t *
99
+ hb_buffer_get_empty (void);
100
+
101
+ hb_buffer_t *
102
+ hb_buffer_reference (hb_buffer_t *buffer);
103
+
104
+ void
105
+ hb_buffer_destroy (hb_buffer_t *buffer);
106
+
107
+ hb_bool_t
108
+ hb_buffer_set_user_data (hb_buffer_t *buffer,
109
+ hb_user_data_key_t *key,
110
+ void * data,
111
+ hb_destroy_func_t destroy,
112
+ hb_bool_t replace);
113
+
114
+ void *
115
+ hb_buffer_get_user_data (hb_buffer_t *buffer,
116
+ hb_user_data_key_t *key);
117
+
118
+
119
+ typedef enum {
120
+ HB_BUFFER_CONTENT_TYPE_INVALID = 0,
121
+ HB_BUFFER_CONTENT_TYPE_UNICODE,
122
+ HB_BUFFER_CONTENT_TYPE_GLYPHS
123
+ } hb_buffer_content_type_t;
124
+
125
+ void
126
+ hb_buffer_set_content_type (hb_buffer_t *buffer,
127
+ hb_buffer_content_type_t content_type);
128
+
129
+ hb_buffer_content_type_t
130
+ hb_buffer_get_content_type (hb_buffer_t *buffer);
131
+
132
+
133
+ void
134
+ hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
135
+ hb_unicode_funcs_t *unicode_funcs);
136
+
137
+ hb_unicode_funcs_t *
138
+ hb_buffer_get_unicode_funcs (hb_buffer_t *buffer);
139
+
140
+ void
141
+ hb_buffer_set_direction (hb_buffer_t *buffer,
142
+ hb_direction_t direction);
143
+
144
+ hb_direction_t
145
+ hb_buffer_get_direction (hb_buffer_t *buffer);
146
+
147
+ void
148
+ hb_buffer_set_script (hb_buffer_t *buffer,
149
+ hb_script_t script);
150
+
151
+ hb_script_t
152
+ hb_buffer_get_script (hb_buffer_t *buffer);
153
+
154
+ void
155
+ hb_buffer_set_language (hb_buffer_t *buffer,
156
+ hb_language_t language);
157
+
158
+
159
+ hb_language_t
160
+ hb_buffer_get_language (hb_buffer_t *buffer);
161
+
162
+ void
163
+ hb_buffer_set_segment_properties (hb_buffer_t *buffer,
164
+ const hb_segment_properties_t *props);
165
+
166
+ void
167
+ hb_buffer_get_segment_properties (hb_buffer_t *buffer,
168
+ hb_segment_properties_t *props);
169
+
170
+ void
171
+ hb_buffer_guess_segment_properties (hb_buffer_t *buffer);
172
+
173
+
174
+ typedef enum {
175
+ HB_BUFFER_FLAGS_DEFAULT = 0x00000000,
176
+ HB_BUFFER_FLAG_BOT = 0x00000001, /* Beginning-of-text */
177
+ HB_BUFFER_FLAG_EOT = 0x00000002, /* End-of-text */
178
+ HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES = 0x00000004
179
+ } hb_buffer_flags_t;
180
+
181
+ void
182
+ hb_buffer_set_flags (hb_buffer_t *buffer,
183
+ hb_buffer_flags_t flags);
184
+
185
+ hb_buffer_flags_t
186
+ hb_buffer_get_flags (hb_buffer_t *buffer);
187
+
188
+
189
+ /* Resets the buffer. Afterwards it's as if it was just created,
190
+ * except that it has a larger buffer allocated perhaps... */
191
+ void
192
+ hb_buffer_reset (hb_buffer_t *buffer);
193
+
194
+ /* Like reset, but does NOT clear unicode_funcs. */
195
+ void
196
+ hb_buffer_clear_contents (hb_buffer_t *buffer);
197
+
198
+ /* Returns false if allocation failed */
199
+ hb_bool_t
200
+ hb_buffer_pre_allocate (hb_buffer_t *buffer,
201
+ unsigned int size);
202
+
203
+
204
+ /* Returns false if allocation has failed before */
205
+ hb_bool_t
206
+ hb_buffer_allocation_successful (hb_buffer_t *buffer);
207
+
208
+ void
209
+ hb_buffer_reverse (hb_buffer_t *buffer);
210
+
211
+ void
212
+ hb_buffer_reverse_clusters (hb_buffer_t *buffer);
213
+
214
+
215
+ /* Filling the buffer in */
216
+
217
+ void
218
+ hb_buffer_add (hb_buffer_t *buffer,
219
+ hb_codepoint_t codepoint,
220
+ unsigned int cluster);
221
+
222
+ void
223
+ hb_buffer_add_utf8 (hb_buffer_t *buffer,
224
+ const char *text,
225
+ int text_length,
226
+ unsigned int item_offset,
227
+ int item_length);
228
+
229
+ void
230
+ hb_buffer_add_utf16 (hb_buffer_t *buffer,
231
+ const uint16_t *text,
232
+ int text_length,
233
+ unsigned int item_offset,
234
+ int item_length);
235
+
236
+ void
237
+ hb_buffer_add_utf32 (hb_buffer_t *buffer,
238
+ const uint32_t *text,
239
+ int text_length,
240
+ unsigned int item_offset,
241
+ int item_length);
242
+
243
+
244
+ /* Clears any new items added at the end */
245
+ hb_bool_t
246
+ hb_buffer_set_length (hb_buffer_t *buffer,
247
+ unsigned int length);
248
+
249
+ /* Return value valid as long as buffer not modified */
250
+ unsigned int
251
+ hb_buffer_get_length (hb_buffer_t *buffer);
252
+
253
+ /* Getting glyphs out of the buffer */
254
+
255
+ /* Return value valid as long as buffer not modified */
256
+ hb_glyph_info_t *
257
+ hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
258
+ unsigned int *length);
259
+
260
+ /* Return value valid as long as buffer not modified */
261
+ hb_glyph_position_t *
262
+ hb_buffer_get_glyph_positions (hb_buffer_t *buffer,
263
+ unsigned int *length);
264
+
265
+
266
+ /* Reorders a glyph buffer to have canonical in-cluster glyph order / position.
267
+ * The resulting clusters should behave identical to pre-reordering clusters.
268
+ * NOTE: This has nothing to do with Unicode normalization. */
269
+ void
270
+ hb_buffer_normalize_glyphs (hb_buffer_t *buffer);
271
+
272
+
273
+ /*
274
+ * Serialize
275
+ */
276
+
277
+ typedef enum {
278
+ HB_BUFFER_SERIALIZE_FLAGS_DEFAULT = 0x00000000,
279
+ HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS = 0x00000001,
280
+ HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS = 0x00000002,
281
+ HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES = 0x00000004
282
+ } hb_buffer_serialize_flags_t;
283
+
284
+ typedef enum {
285
+ HB_BUFFER_SERIALIZE_FORMAT_TEXT = HB_TAG('T','E','X','T'),
286
+ HB_BUFFER_SERIALIZE_FORMAT_JSON = HB_TAG('J','S','O','N'),
287
+ HB_BUFFER_SERIALIZE_FORMAT_INVALID = HB_TAG_NONE
288
+ } hb_buffer_serialize_format_t;
289
+
290
+ /* len=-1 means str is NUL-terminated. */
291
+ hb_buffer_serialize_format_t
292
+ hb_buffer_serialize_format_from_string (const char *str, int len);
293
+
294
+ const char *
295
+ hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format);
296
+
297
+ const char **
298
+ hb_buffer_serialize_list_formats (void);
299
+
300
+ /* Returns number of items, starting at start, that were serialized. */
301
+ unsigned int
302
+ hb_buffer_serialize_glyphs (hb_buffer_t *buffer,
303
+ unsigned int start,
304
+ unsigned int end,
305
+ char *buf,
306
+ unsigned int buf_size,
307
+ unsigned int *buf_consumed, /* May be NULL */
308
+ hb_font_t *font, /* May be NULL */
309
+ hb_buffer_serialize_format_t format,
310
+ hb_buffer_serialize_flags_t flags);
311
+
312
+ hb_bool_t
313
+ hb_buffer_deserialize_glyphs (hb_buffer_t *buffer,
314
+ const char *buf,
315
+ int buf_len, /* -1 means nul-terminated */
316
+ const char **end_ptr, /* May be NULL */
317
+ hb_font_t *font, /* May be NULL */
318
+ hb_buffer_serialize_format_t format);
319
+
320
+
321
+ HB_END_DECLS
322
+
323
+ #endif /* HB_BUFFER_H */