[rendering] Do not write duplicated hashes...
[wikipediardware.git] / host-tools / rendering / patches / 0006-Write-the-position-x-y-the-font-and-the-glyph_ind.patch
blob521b04042863fd3922039a13a3bb621c7581f53c
1 From d1007673708b39b7f1c6f418a88247a92fbb7c9f Mon Sep 17 00:00:00 2001
2 From: Holger Hans Peter Freyther <zecke@selfish.org>
3 Date: Sat, 20 Dec 2008 22:32:20 +0100
4 Subject: [PATCH] Write the position (x,y), the font and the glyph_index on a line
6 These are the positions of each glyph... this format
7 is easy to parse and change in the future... it will be
8 the base of finding a good encoding that is not bigger
9 than then original text file but still contains the layout
10 information.
11 ---
12 WebKitTools/GtkLauncher/main.c | 17 +++++++++++++++++
13 1 files changed, 17 insertions(+), 0 deletions(-)
15 diff --git a/WebKitTools/GtkLauncher/main.c b/WebKitTools/GtkLauncher/main.c
16 index 881d85f..d4247d3 100644
17 --- a/WebKitTools/GtkLauncher/main.c
18 +++ b/WebKitTools/GtkLauncher/main.c
19 @@ -147,9 +147,26 @@ static void create_font_dirs(GList *glyphs)
21 * Write out the text....
23 +static void append_glyph(WebKitGlyph* glyph, GString* string)
25 + g_string_append_printf(string, "%d,%d,%s,%d\n",
26 + glyph->x, glyph->y,
27 + glyph->face_and_config, glyph->glyph_index);
30 static void create_text_file(GList *glyphs)
32 + GString* string = g_string_new(NULL);
33 + g_list_foreach(glyphs, (GFunc)append_glyph, string);
35 + GError* error = NULL;
36 + g_file_set_contents("render_text.blib", string->str, string->len, &error);
37 + if (error) {
38 + g_warning("Failed to write the glyphs...");
39 + g_error_free(error);
40 + }
42 + g_string_free(string, TRUE);
45 static void create_links(GList *links)
46 --
47 1.5.6.3