Hello community,
here is the log from the commit of package freetype2 for openSUSE:Factory
checked in at Wed Jul 29 17:21:51 CEST 2009.
--------
--- freetype2/freetype2.changes 2009-07-07 10:30:45.000000000 +0200
+++ /mounts/work_src_done/STABLE/freetype2/freetype2.changes 2009-07-27 15:45:38.000000000 +0200
@@ -1,0 +2,13 @@
+Mon Jul 27 15:01:04 CEST 2009 - tiwai@suse.de
+
+- updated to version 2.3.9:
+ * see URLs below
+ http://www.freetype.org/index2.html#release-freetype-2.3.9
+ http://sourceforge.net/project/shownotes.php?group_id=3157&release_id=653641
+- updated to version 2.3.9:
+ * see URLs below
+ http://www.freetype.org/index2.html#release-freetype-2.3.9
+ http://sourceforge.net/project/shownotes.php?group_id=3157&release_id=667610
+- fix builds with older distros
+
+-------------------------------------------------------------------
--- freetype2/ft2demos.changes 2009-05-06 18:38:43.000000000 +0200
+++ /mounts/work_src_done/STABLE/freetype2/ft2demos.changes 2009-07-27 15:45:38.000000000 +0200
@@ -1,0 +2,13 @@
+Mon Jul 27 15:05:32 CEST 2009 - tiwai@suse.de
+
+- updated to version 2.3.9:
+ * see URLs below
+ http://www.freetype.org/index2.html#release-freetype-2.3.9
+ http://sourceforge.net/project/shownotes.php?group_id=3157&release_id=653641
+- updated to version 2.3.9:
+ * see URLs below
+ http://www.freetype.org/index2.html#release-freetype-2.3.9
+ http://sourceforge.net/project/shownotes.php?group_id=3157&release_id=667610
+- fix builds with older distros
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
bnc441638-bc-enabling-fix-from-cvs.patch
freetype-2.3.7.tar.bz2
freetype-doc-2.3.7.tar.bz2
ft2demos-2.3.7.tar.bz2
uninitialized-variable.patch
New:
----
freetype-2.3.9.tar.bz2
freetype-doc-2.3.9.tar.bz2
ft2demos-2.3.9.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ freetype2.spec ++++++
--- /var/tmp/diff_new_pack.NkhnF4/_old 2009-07-29 17:20:47.000000000 +0200
+++ /var/tmp/diff_new_pack.NkhnF4/_new 2009-07-29 17:20:47.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package freetype2 (Version 2.3.7)
+# spec file for package freetype2 (Version 2.3.9)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -28,8 +28,8 @@
Obsoletes: freetype2-64bit
%endif
#
-Version: 2.3.7
-Release: 27
+Version: 2.3.9
+Release: 1
Url: http://www.freetype.org
Summary: A TrueType Font Library
# CVS repository:
@@ -45,9 +45,7 @@
Patch5: revert-fix-bytecode.patch
Patch8: bugzilla-159166-reduce-embolden-distance.patch
Patch9: fix-build.patch
-Patch10: uninitialized-variable.patch
Patch308961: bugzilla-308961-cmex-workaround.patch
-Patch441638: bnc441638-bc-enabling-fix-from-cvs.patch
Patch11: bnc485889-overflow1.patch
Patch12: bnc485889-overflow2.patch
Patch13: bnc485889-overflow3.patch
@@ -111,9 +109,7 @@
#%patch5 -p 1
#%patch8 -p 1
%patch9 -p 1
-%patch10 -p 1
%patch308961 -p 1
-%patch441638 -p 1
%patch11 -p 1
%patch12 -p 1
%patch13 -p 1
@@ -132,7 +128,9 @@
cp /usr/share/automake*/config.{guess,sub} builds/unix
%build
+%if %suse_version > 1110
sh ./autogen.sh
+%endif
export CFLAGS="$RPM_OPT_FLAGS -g -fno-strict-aliasing "
ln -s /usr/bin/libtool ./builds/unix/libtool
make setup CFG="--prefix=/usr --libdir=%{_libdir} --with-zlib"
++++++ ft2demos.spec ++++++
--- /var/tmp/diff_new_pack.NkhnF4/_old 2009-07-29 17:20:47.000000000 +0200
+++ /var/tmp/diff_new_pack.NkhnF4/_new 2009-07-29 17:20:47.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package ft2demos (Version 2.3.7)
+# spec file for package ft2demos (Version 2.3.9)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -26,8 +26,8 @@
%if %suse_version > 1000
Supplements: fonts-config
%endif
-Version: 2.3.7
-Release: 34
+Version: 2.3.9
+Release: 1
%define freetype_version %{version}
Url: http://www.freetype.org
Summary: Freetype2 Utilities and Demo Programs
@@ -47,7 +47,6 @@
Patch8: bugzilla-159166-reduce-embolden-distance.patch
Patch9: fix-build.patch
Patch308961: bugzilla-308961-cmex-workaround.patch
-Patch441638: bnc441638-bc-enabling-fix-from-cvs.patch
Patch11: bnc485889-overflow1.patch
Patch12: bnc485889-overflow2.patch
Patch13: bnc485889-overflow3.patch
@@ -87,7 +86,6 @@
#%patch8 -p 1
%patch9 -p 1
%patch308961 -p 1
-%patch441638 -p 1
%patch11 -p 1
%patch12 -p 1
%patch13 -p 1
@@ -112,7 +110,9 @@
cp /usr/share/automake*/config.{guess,sub} builds/unix
%build
+%if %suse_version > 1110
sh ./autogen.sh
+%endif
export CFLAGS="$RPM_OPT_FLAGS -g -fno-strict-aliasing "
ln -s /usr/bin/libtool ./builds/unix/libtool
make setup CFG="--prefix=/usr --libdir=%{_libdir} --with-zlib"
++++++ freetype-2.3.7.tar.bz2 -> freetype-2.3.9.tar.bz2 ++++++
++++ 63175 lines of diff (skipped)
++++++ freetype-doc-2.3.7.tar.bz2 -> freetype-doc-2.3.9.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freetype-2.3.7/docs/design/design-5.html new/freetype-2.3.9/docs/design/design-5.html
--- old/freetype-2.3.7/docs/design/design-5.html 2007-02-06 12:10:51.000000000 +0100
+++ new/freetype-2.3.9/docs/design/design-5.html 2009-03-11 06:53:53.000000000 +0100
@@ -343,7 +343,7 @@
</tr>
<tr valign=top>
<td>
- <tt>module_requires</tt>
+ <tt>module_interface</tt>
</td>
<td>
<p>Most modules support one or more "interfaces", i.e. tables of
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freetype-2.3.7/docs/tutorial/example2.cpp new/freetype-2.3.9/docs/tutorial/example2.cpp
--- old/freetype-2.3.7/docs/tutorial/example2.cpp 1970-01-01 01:00:00.000000000 +0100
+++ new/freetype-2.3.9/docs/tutorial/example2.cpp 2009-03-07 09:10:06.000000000 +0100
@@ -0,0 +1,400 @@
+// example2.cpp
+
+// This file demonstrates how to render a coloured glyph with a differently
+// coloured outline.
+//
+// Written Feb. 2009 by Erik M�ller,
+// with slight modifications by Werner Lemberg
+//
+// Public domain.
+//
+// Eric uses similar code in real applications; see
+//
+// http://www.timetrap.se
+// http://www.emberwind.se
+//
+// for more.
+
+#include
+#include FT_FREETYPE_H
+#include FT_STROKER_H
+
+#include <vector>
+#include <fstream>
+#include <iostream>
+
+
+#ifdef _MSC_VER
+#define MIN __min
+#define MAX __max
+#else
+#define MIN std::min
+#define MAX std::max
+#endif
+
+
+// Define some fixed size types.
+
+typedef unsigned char uint8;
+typedef unsigned short uint16;
+typedef unsigned int uint32;
+
+
+// Try to figure out what endian this machine is using. Note that the test
+// below might fail for cross compilation; additionally, multi-byte
+// characters are implementation-defined in C preprocessors.
+
+#if (('1234' >> 24) == '1')
+#elif (('4321' >> 24) == '1')
+ #define BIG_ENDIAN
+#else
+ #error "Couldn't determine the endianness!"
+#endif
+
+
+// A simple 32-bit pixel.
+
+union Pixel32
+{
+ Pixel32()
+ : integer(0) { }
+ Pixel32(uint8 bi, uint8 gi, uint8 ri, uint8 ai = 255)
+ {
+ b = bi;
+ g = gi;
+ r = ri;
+ a = ai;
+ }
+
+ uint32 integer;
+
+ struct
+ {
+#ifdef BIG_ENDIAN
+ uint8 a, r, g, b;
+#else // BIG_ENDIAN
+ uint8 b, g, r, a;
+#endif // BIG_ENDIAN
+ };
+};
+
+
+struct Vec2
+{
+ Vec2() { }
+ Vec2(float a, float b)
+ : x(a), y(b) { }
+
+ float x, y;
+};
+
+
+struct Rect
+{
+ Rect() { }
+ Rect(float left, float top, float right, float bottom)
+ : xmin(left), xmax(right), ymin(top), ymax(bottom) { }
+
+ void Include(const Vec2 &r)
+ {
+ xmin = MIN(xmin, r.x);
+ ymin = MIN(ymin, r.y);
+ xmax = MAX(xmax, r.x);
+ ymax = MAX(ymax, r.y);
+ }
+
+ float Width() const { return xmax - xmin + 1; }
+ float Height() const { return ymax - ymin + 1; }
+
+ float xmin, xmax, ymin, ymax;
+};
+
+
+// TGA Header struct to make it simple to dump a TGA to disc.
+
+#if defined(_MSC_VER) || defined(__GNUC__)
+#pragma pack(push, 1)
+#pragma pack(1) // Dont pad the following struct.
+#endif
+
+struct TGAHeader
+{
+ uint8 idLength, // Length of optional identification sequence.
+ paletteType, // Is a palette present? (1=yes)
+ imageType; // Image data type (0=none, 1=indexed, 2=rgb,
+ // 3=grey, +8=rle packed).
+ uint16 firstPaletteEntry, // First palette index, if present.
+ numPaletteEntries; // Number of palette entries, if present.
+ uint8 paletteBits; // Number of bits per palette entry.
+ uint16 x, // Horiz. pixel coord. of lower left of image.
+ y, // Vert. pixel coord. of lower left of image.
+ width, // Image width in pixels.
+ height; // Image height in pixels.
+ uint8 depth, // Image color depth (bits per pixel).
+ descriptor; // Image attribute flags.
+};
+
+#if defined(_MSC_VER) || defined(__GNUC__)
+#pragma pack(pop)
+#endif
+
+
+bool
+WriteTGA(const std::string &filename,
+ const Pixel32 *pxl,
+ uint16 width,
+ uint16 height)
+{
+ std::ofstream file(filename.c_str(), std::ios::binary);
+ if (file)
+ {
+ TGAHeader header;
+ memset(&header, 0, sizeof(TGAHeader));
+ header.imageType = 2;
+ header.width = width;
+ header.height = height;
+ header.depth = 32;
+ header.descriptor = 0x20;
+
+ file.write((const char *)&header, sizeof(TGAHeader));
+ file.write((const char *)pxl, sizeof(Pixel32) * width * height);
+
+ return true;
+ }
+ return false;
+}
+
+
+// A horizontal pixel span generated by the FreeType renderer.
+
+struct Span
+{
+ Span() { }
+ Span(int _x, int _y, int _width, int _coverage)
+ : x(_x), y(_y), width(_width), coverage(_coverage) { }
+
+ int x, y, width, coverage;
+};
+
+typedef std::vector<Span> Spans;
+
+
+// Each time the renderer calls us back we just push another span entry on
+// our list.
+
+void
+RasterCallback(const int y,
+ const int count,
+ const FT_Span * const spans,
+ void * const user)
+{
+ Spans *sptr = (Spans *)user;
+ for (int i = 0; i < count; ++i)
+ sptr->push_back(Span(spans[i].x, y, spans[i].len, spans[i].coverage));
+}
+
+
+// Set up the raster parameters and render the outline.
+
+void
+RenderSpans(FT_Library &library,
+ FT_Outline * const outline,
+ Spans *spans)
+{
+ FT_Raster_Params params;
+ memset(¶ms, 0, sizeof(params));
+ params.flags = FT_RASTER_FLAG_AA | FT_RASTER_FLAG_DIRECT;
+ params.gray_spans = RasterCallback;
+ params.user = spans;
+
+ FT_Outline_Render(library, outline, ¶ms);
+}
+
+
+// Render the specified character as a colored glyph with a colored outline
+// and dump it to a TGA.
+
+void
+WriteGlyphAsTGA(FT_Library &library,
+ const std::string &fileName,
+ wchar_t ch,
+ FT_Face &face,
+ int size,
+ const Pixel32 &fontCol,
+ const Pixel32 outlineCol,
+ float outlineWidth)
+{
+ // Set the size to use.
+ if (FT_Set_Char_Size(face, size << 6, size << 6, 90, 90) == 0)
+ {
+ // Load the glyph we are looking for.
+ FT_UInt gindex = FT_Get_Char_Index(face, ch);
+ if (FT_Load_Glyph(face, gindex, FT_LOAD_NO_BITMAP) == 0)
+ {
+ // Need an outline for this to work.
+ if (face->glyph->format == FT_GLYPH_FORMAT_OUTLINE)
+ {
+ // Render the basic glyph to a span list.
+ Spans spans;
+ RenderSpans(library, &face->glyph->outline, &spans);
+
+ // Next we need the spans for the outline.
+ Spans outlineSpans;
+
+ // Set up a stroker.
+ FT_Stroker stroker;
+ FT_Stroker_New(library, &stroker);
+ FT_Stroker_Set(stroker,
+ (int)(outlineWidth * 64),
+ FT_STROKER_LINECAP_ROUND,
+ FT_STROKER_LINEJOIN_ROUND,
+ 0);
+
+ FT_Glyph glyph;
+ if (FT_Get_Glyph(face->glyph, &glyph) == 0)
+ {
+ FT_Glyph_StrokeBorder(&glyph, stroker, 0, 1);
+ // Again, this needs to be an outline to work.
+ if (glyph->format == FT_GLYPH_FORMAT_OUTLINE)
+ {
+ // Render the outline spans to the span list
+ FT_Outline *o =
+ &reinterpret_cast(glyph)->outline;
+ RenderSpans(library, o, &outlineSpans);
+ }
+
+ // Clean up afterwards.
+ FT_Stroker_Done(stroker);
+ FT_Done_Glyph(glyph);
+
+ // Now we need to put it all together.
+ if (!spans.empty())
+ {
+ // Figure out what the bounding rect is for both the span lists.
+ Rect rect(spans.front().x,
+ spans.front().y,
+ spans.front().x,
+ spans.front().y);
+ for (Spans::iterator s = spans.begin();
+ s != spans.end(); ++s)
+ {
+ rect.Include(Vec2(s->x, s->y));
+ rect.Include(Vec2(s->x + s->width - 1, s->y));
+ }
+ for (Spans::iterator s = outlineSpans.begin();
+ s != outlineSpans.end(); ++s)
+ {
+ rect.Include(Vec2(s->x, s->y));
+ rect.Include(Vec2(s->x + s->width - 1, s->y));
+ }
+
+#if 0
+ // This is unused in this test but you would need this to draw
+ // more than one glyph.
+ float bearingX = face->glyph->metrics.horiBearingX >> 6;
+ float bearingY = face->glyph->metrics.horiBearingY >> 6;
+ float advance = face->glyph->advance.x >> 6;
+#endif
+
+ // Get some metrics of our image.
+ int imgWidth = rect.Width(),
+ imgHeight = rect.Height(),
+ imgSize = imgWidth * imgHeight;
+
+ // Allocate data for our image and clear it out to transparent.
+ Pixel32 *pxl = new Pixel32[imgSize];
+ memset(pxl, 0, sizeof(Pixel32) * imgSize);
+
+ // Loop over the outline spans and just draw them into the
+ // image.
+ for (Spans::iterator s = outlineSpans.begin();
+ s != outlineSpans.end(); ++s)
+ for (int w = 0; w < s->width; ++w)
+ pxl[(int)((imgHeight - 1 - (s->y - rect.ymin)) * imgWidth
+ + s->x - rect.xmin + w)] =
+ Pixel32(outlineCol.r, outlineCol.g, outlineCol.b,
+ s->coverage);
+
+ // Then loop over the regular glyph spans and blend them into
+ // the image.
+ for (Spans::iterator s = spans.begin();
+ s != spans.end(); ++s)
+ for (int w = 0; w < s->width; ++w)
+ {
+ Pixel32 &dst =
+ pxl[(int)((imgHeight - 1 - (s->y - rect.ymin)) * imgWidth
+ + s->x - rect.xmin + w)];
+ Pixel32 src = Pixel32(fontCol.r, fontCol.g, fontCol.b,
+ s->coverage);
+ dst.r = (int)(dst.r + ((src.r - dst.r) * src.a) / 255.0f);
+ dst.g = (int)(dst.g + ((src.g - dst.g) * src.a) / 255.0f);
+ dst.b = (int)(dst.b + ((src.b - dst.b) * src.a) / 255.0f);
+ dst.a = MIN(255, dst.a + src.a);
+ }
+
+ // Dump the image to disk.
+ WriteTGA(fileName, pxl, imgWidth, imgHeight);
+
+ delete [] pxl;
+ }
+ }
+ }
+ }
+ }
+}
+
+
+int
+main(int argc,
+ char **argv)
+{
+ if (argc != 3)
+ {
+ std::cerr << "Render letter `B' of given font as a TGA image.\n";
+ std::cerr << "\n";
+ std::cerr << "usage: example2 <font> <TGA-file>\n";
+ return 1;
+ }
+
+ // Initialize FreeType.
+ FT_Library library;
+ FT_Init_FreeType(&library);
+
+ // Open up a font file.
+ std::ifstream fontFile(argv[1], std::ios::binary);
+ if (fontFile)
+ {
+ // Read the entire file to a memory buffer.
+ fontFile.seekg(0, std::ios::end);
+ std::fstream::pos_type fontFileSize = fontFile.tellg();
+ fontFile.seekg(0);
+ unsigned char *fontBuffer = new unsigned char[fontFileSize];
+ fontFile.read((char *)fontBuffer, fontFileSize);
+
+ // Create a face from a memory buffer. Be sure not to delete the memory
+ // buffer until you are done using that font as FreeType will reference
+ // it directly.
+ FT_Face face;
+ FT_New_Memory_Face(library, fontBuffer, fontFileSize, 0, &face);
+
+ // Dump out a single glyph to a tga.
+ WriteGlyphAsTGA(library,
+ argv[2],
+ L'B',
+ face,
+ 100,
+ Pixel32(255, 90, 30),
+ Pixel32(255, 255, 255),
+ 3.0f);
+
+ // Now that we are done it is safe to delete the memory.
+ delete [] fontBuffer;
+ }
+
+ // Clean up the library
+ FT_Done_FreeType(library);
+
+ return 1;
+}
+
+/* EOF */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freetype-2.3.7/docs/tutorial/step2.html new/freetype-2.3.9/docs/tutorial/step2.html
--- old/freetype-2.3.7/docs/tutorial/step2.html 2007-02-06 12:12:12.000000000 +0100
+++ new/freetype-2.3.9/docs/tutorial/step2.html 2009-03-07 09:41:58.000000000 +0100
@@ -47,9 +47,9 @@
</h1>
<h3 align=center>
- © 2003, 2006, 2007 David Turner
+ © 2009 David Turner
(<a href="mailto:david@freetype.org">david@freetype.org</a>)<br>
- © 2003, 2006, 2007 The FreeType Development Team
+ © 2009 The FreeType Development Team
(<a href="http://www.freetype.org">www.freetype.org</a>)
</h3>
@@ -63,8 +63,8 @@
Introduction
</h2>
- <p>This is the second section of the FreeType 2 tutorial. It describes
- how to</p>
+ <p>This is the second section of the FreeType 2 tutorial. It
+ describes how to</p>
<ul>
<li>retrieve glyph metrics</li>
@@ -99,7 +99,7 @@
<p>Individual glyph metrics can be accessed by first loading the glyph
in a face's glyph slot, then accessing them through the
<tt>face->glyph->metrics</tt> structure, whose type is
+ href="../reference/ft2-base_interface.html#FT_Glyph_Metrics">
<tt>FT_Glyph_Metrics</tt></a>. We will discuss this in more detail
below; for now, we only note that it contains the following fields:</p>
@@ -279,7 +279,7 @@
and even perform additional transformations and measures on it before
converting it to a bitmap.</p>
- <p>The FreeType 2 API has a specific extension which is capable of
+ <p>The FreeType 2 API has a specific extension which is capable of
dealing with glyph images in a flexible and generic way. To use it, you
first need to include the <a
href="../reference/ft2-header_file_macros.html#FT_GLYPH_H">
@@ -465,7 +465,7 @@
<p>You may need to convert the glyph object to a bitmap once you have
conveniently cached or transformed it. This can be done easily with
the <a href="../reference/ft2-glyph_management.html">
- <tt>FT_Glyph_To_Bitmap</tt></a> function. It is in charge of
+ <tt>FT_Glyph_To_Bitmap</tt></a> function. It is in charge of
converting any glyph object into a bitmap, as in:</p>
<div class="pre">
@@ -605,12 +605,11 @@
</tr>
<tr valign=top>
<td>
- <tt>global_bbox</tt>
+ <tt>bbox</tt>
</td>
<td>
<p>The global bounding box is defined as the largest rectangle
- that can enclose all the glyphs in a font face. It is defined for
- horizontal layouts only.</p>
+ that can enclose all the glyphs in a font face.</p>
</td>
</tr>
<tr valign=top>
@@ -624,7 +623,7 @@
differently. For some, it represents the ascent of all capital
latin characters (without accents), for others it is the ascent of
the highest accented character, and finally, other formats define
- it as being equal to <tt>global_bbox.yMax</tt>.</p>
+ it as being equal to <tt>bbox.yMax</tt>.</p>
</td>
</tr>
<tr valign=top>
@@ -638,20 +637,20 @@
differently. For some, it represents the descent of all capital
latin characters (without accents), for others it is the ascent of
the lowest accented character, and finally, other formats define
- it as being equal to <tt>global_bbox.yMin</tt>. This field is
+ it as being equal to <tt>bbox.yMin</tt>. This field is
negative for values below the baseline.</p>
</td>
</tr>
<tr valign=top>
<td>
- <tt>text_height</tt>
+ <tt>height</tt>
</td>
<td>
- <p>This field is simply used to compute a default line spacing
- (i.e., the baseline-to-baseline distance) when writing text with
- this font. Note that it usually is larger than the sum of the
- ascender and descender taken as absolute values. There is also no
- guarantee that no glyphs extend above or below subsequent
+ <p>This field is simply used to compute a <i>default</i> line
+ spacing (i.e., the baseline-to-baseline distance) when writing
+ text with this font. Note that it usually is larger than the sum
+ of the ascender and descender taken as absolute values. There is
+ also no guarantee that no glyphs extend above or below subsequent
baselines when using this distance.</p>
</td>
</tr>
@@ -672,8 +671,7 @@
</td>
<td>
<p>Same as <tt>max_advance_width</tt> but for vertical text
- layout. It is only available in fonts providing vertical glyph
- metrics.</p>
+ layout.</p>
</td>
</tr>
<tr valign=top>
@@ -683,7 +681,7 @@
<td>
<p>When displaying or rendering underlined text, this value
corresponds to the vertical position, relative to the baseline, of
- the underline bar. It is negative if it is below the
+ the underline bar's center. It is negative if it is below the
baseline.</p>
</td>
</tr>
@@ -712,7 +710,7 @@
the <tt>face->size->metrics</tt> structure.</p>
<p>Note that these values correspond to scaled versions of the design
- global metrics, <em>with no rounding/grid-fitting performed</em>.
+ global metrics, <em>with no rounding or grid-fitting performed</em>.
They are also completely independent of any hinting process. In other
words, don't rely on them to get exact metrics at the pixel level.
They are expressed in 26.6 pixel format.</p>
@@ -1347,7 +1345,7 @@
... load glyph sequence ...
- ... setup "matrix" and "delta" ...
+ ... set up "matrix" and "delta" ...
<span class="comment">/* transform glyphs */</span>
for ( n = 0; n < num_glyphs; n++ )
@@ -1656,17 +1654,17 @@
<p>The next section will deal with FreeType 2 internals (like
modules, vector outlines, font drivers, renderers), as well as a few
font format specific issues (mainly, how to access certain TrueType or
- Type 1 tables). [This section has not been written yet.]</p>
+ Type 1 tables).</p>
</td></tr>
</table>
</center>
<h3 align=center>
- <a href="step1.html">FreeType 2 Tutorial Step 1</a>
+ <a href="step3.html">FreeType 2 Tutorial Step 3</a>
</h3>
-<p><font size=-3>Last update: 06-Feb-2007</font></p>
+<p><font size=-3>Last update: 07-Mar-2009</font></p>
</body>
</html>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freetype-2.3.7/docs/tutorial/step3.html new/freetype-2.3.9/docs/tutorial/step3.html
--- old/freetype-2.3.7/docs/tutorial/step3.html 1970-01-01 01:00:00.000000000 +0100
+++ new/freetype-2.3.9/docs/tutorial/step3.html 2009-03-07 09:45:05.000000000 +0100
@@ -0,0 +1,96 @@
+http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <style type="text/css">
+ body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
+ color: #000000;
+ background: #FFFFFF; }
+
+ p { text-align: justify; }
+ h1 { text-align: center; }
+ li { text-align: justify; }
+ td { padding: 0 0.5em 0 0.5em; }
+
+ a:link { color: #0000EF; }
+ a:visited { color: #51188E; }
+ a:hover { color: #FF0000; }
+
+ div.pre { font-family: monospace;
+ text-align: left;
+ white-space: pre;
+ color: blue; }
+
+ div.example { font-family: monospace;
+ text-align: left;
+ white-space: pre;
+ color: purple; }
+
+ span.comment { color: gray; }
+ </style>
+
+
+ <title>FreeType 2 Tutorial</title>
+</head>
+
+
+
+<h1 align=center>
+ FreeType 2 Tutorial<br>
+ Step 3 — handling internals
+</h1>
+
+<h3 align=center>
+ © 2009 Werner Lemberg
+ (<a href="mailto:wl@gnu.org">wl@gnu.org</a>)<br>
+ © 2009 The FreeType Development Team
+ (<a href="http://www.freetype.org">www.freetype.org</a>)
+</h3>
+
+<center>
+<table width="70%">
+<tr><td>
+
+ <hr>
+
+ <h2>
+ Introduction
+ </h2>
+
+ <p>This is the third section of the FreeType 2 tutorial. It
+ describes how to deal with various internals of the library like</p>
+
+ <ul>
+ <li>the module interface</li>
+ <li>functions for manipulating vector outlines</li>
+ <li>font driver issues</li>
+ <li>interaction with renderers using callbacks</li>
+ <li>accessing font specific data, for example PostScript font
+ dictionaries and TrueType tables</li>
+ </ul>
+
+ <p>None of these items have been written yet. However, Erik M�ller</a> contributed a very nice C++
+ example which shows renderer callbacks in action to draw a coloured glyph
+ with a differently coloured outline.</p>
+
+ <p>The source code can be found <a href="example2.cpp">here</a>.</p>
+
+</td></tr>
+</table>
+</center>
+
+<h3 align=center>
+ <a href="step1.html">FreeType 2 Tutorial Step 1</a>
+</h3>
+
+<p><font size=-3>Last update: 07-Mar-2009</font></p>
+
+</body>
+</html>
++++++ ft2demos-2.3.7.tar.bz2 -> ft2demos-2.3.9.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.3.7/ChangeLog new/ft2demos-2.3.9/ChangeLog
--- old/ft2demos-2.3.7/ChangeLog 2008-06-29 09:42:49.000000000 +0200
+++ new/ft2demos-2.3.9/ChangeLog 2009-03-12 10:54:50.000000000 +0100
@@ -1,3 +1,81 @@
+2009-03-12 Werner Lemberg
+
+ * Version 2.3.9 released.
+ =========================
+
+
+ Tag sources with `VER-2-3-9'.
+
+ * README: Updated.
+
+2009-03-10 Werner Lemberg
+
+ * src/common.c (CONST): New macro, defined depending on __STDC__.
+ Use it where necessary.
+
+2009-03-10 Werner Lemberg
+
+ Fix C++ compilation.
+
+ * src/ftbench.c (test_load_advances): Use cast.
+ * src/ftgrid.c: Protect `extern' declarations with `extern "C"'.
+
+2009-03-03 Werner Lemberg
+
+ Fix signedness issues.
+
+ * src/ftcommon.c (FTDemo_String_Set): Fix signedness.
+ Update callers.
+ Include `common.h'.
+ Use __STDC__ macro.
+ * src/ftcommon.h (FTDemo_String_Set): Fix signedness.
+
+ * src/common.h, src/common.c: Use __STDC__ macro.
+
+2009-03-03 David Turner
+
+ Add utf-8 support to ftview. Fixes Savannah BUG #18225.
+
+ * src/common.h, src/common.c: Add `utf8_next' function.
+ * src/ftcommon.c (FTDemo_String_Set), src/ftview.c (Render_Text):
+ Use `utf8_next'.
+
+2009-01-14 Werner Lemberg
+
+
+ * Version 2.3.8 released.
+ =========================
+
+
+ Tag sources with `VER-2-3-8'.
+
+ * README: Updated.
+
+2009-01-07 Werner Lemberg
+
+ ftdiff: Add `a' key to toggle global advance width.
+
+ * src/ftdiff.c (ColumnStateRec): Add `use_global_advance_width'
+ field.
+ (render_state_init): Updated.
+ (render_state_draw): Control FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH.
+ Update screen output.
+ (event_help): Document `a' key.
+ Sort output.
+ (process_keys): Handle `a' key.
+ Sort entries in `case' block.
+
+2008-12-05 Werner Lemberg
+
+ * src/ftbench.c: Remove #if FT_ADVANCES_H ... conditionals.
+
+2008-09-02 David Turner
+
+ * src/ftbench.c: Include FT_ADVANCES_H.
+ (FT_BENCH_LOAD_ADVANCES): New enumeration value.
+ (test_load_advances): New function.
+ (main) : New case.
+
2008-06-29 Werner Lemberg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.3.7/README new/ft2demos-2.3.9/README
--- old/ft2demos-2.3.7/README 2008-06-29 09:43:02.000000000 +0200
+++ new/ft2demos-2.3.9/README 2009-03-12 10:54:38.000000000 +0100
@@ -8,8 +8,8 @@
downloaded one of the stable FreeType 2 source packages from our
server, you most probably have to rename its directory, for example:
- mv freetype-2.3.7 freetype2 on Unix
- rename freetype-2.3.7 freetype2 on Windows
+ mv freetype-2.3.9 freetype2 on Unix
+ rename freetype-2.3.9 freetype2 on Windows
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.3.7/src/common.c new/ft2demos-2.3.9/src/common.c
--- old/ft2demos-2.3.7/src/common.c 2005-11-30 09:41:34.000000000 +0100
+++ new/ft2demos-2.3.9/src/common.c 2009-03-11 16:58:39.000000000 +0100
@@ -8,7 +8,7 @@
* mleisher@crl.nmsu.edu (Mark Leisher)
* 10 October 1997
*
- * Last update 2005-11-30.
+ * Last update 2009-03-11.
*/
#include "common.h"
@@ -18,6 +18,12 @@
#include
#include
+#ifdef __STDC__
+#define CONST const
+#else
+#define CONST
+#endif
+
/*
* Externals visible to programs.
*/
@@ -32,13 +38,8 @@
*/
static int cmdac;
-#ifdef __STDC__
- static const char* cmdname;
- static char* const* cmdav;
-#else
- static char* cmdname;
- static char** cmdav;
-#endif
+ static CONST char* cmdname;
+ static char* CONST* cmdav;
int
#ifdef __STDC__
@@ -51,13 +52,8 @@
#endif
{
int opt;
-#ifdef __STDC__
- const char* p;
- const char* pp;
-#else
- char* p;
- char* pp;
-#endif
+ CONST char* p;
+ CONST char* pp;
/*
* If there is no pattern, indicate the parsing is done.
@@ -190,13 +186,8 @@
char* name;
#endif
{
-#ifdef __STDC__
- const char* base;
- const char* current;
-#else
- char* base;
- char* current;
-#endif
+ CONST char* base;
+ CONST char* current;
char c;
base = name;
@@ -221,11 +212,12 @@
}
+ void
#ifdef __STDC__
- void Panic( const char* fmt, ... )
+ Panic( const char* fmt, ... )
#else
- void Panic( fmt )
- const char* fmt;
+ Panic( fmt )
+ char* fmt;
#endif
{
va_list ap;
@@ -239,4 +231,63 @@
}
+ extern int
+#ifdef __STDC__
+ utf8_next( const char** pcursor,
+ const char* end )
+#else
+ utf8_next( pcursor, end )
+ char** pcursor;
+ char* end;
+#endif
+ {
+ CONST unsigned char* p = (CONST unsigned char*)*pcursor;
+ int ch;
+
+
+ if ( (CONST char*)p >= end ) /* end of stream */
+ return -1;
+
+ ch = *p++;
+ if ( ch >= 0x80 )
+ {
+ int len;
+
+
+ if ( ch < 0xc0 ) /* malformed data */
+ goto BAD_DATA;
+ else if ( ch < 0xe0 )
+ {
+ len = 1;
+ ch &= 0x1f;
+ }
+ else if ( ch < 0xf0 )
+ {
+ len = 2;
+ ch &= 0x0f;
+ }
+ else
+ {
+ len = 3;
+ ch &= 0x07;
+ }
+
+ while ( len > 0 )
+ {
+ if ( (CONST char*)p >= end || ( p[0] & 0xc0 ) != 0x80 )
+ goto BAD_DATA;
+
+ ch = ( ch << 6 ) | ( p[0] & 0x3f );
+ p += 1;
+ len -= 1;
+ }
+ }
+
+ *pcursor = (CONST char*) p;
+ return ch;
+
+ BAD_DATA:
+ return -1;
+ }
+
/* End */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.3.7/src/common.h new/ft2demos-2.3.9/src/common.h
--- old/ft2demos-2.3.7/src/common.h 2002-01-25 17:04:51.000000000 +0100
+++ new/ft2demos-2.3.9/src/common.h 2009-03-03 23:59:36.000000000 +0100
@@ -42,12 +42,25 @@
);
/* print a message and exit */
- extern void Panic (
+ extern void Panic(
#ifdef __STDC__
const char* fmt, ...
#endif
);
+ /* read the next UTF-8 code from `*pcursor' and
+ * returns its value. `end' is the limit of the
+ * input string.
+ *
+ * return -1 if the end of the input string is
+ * reached, or in case of malformed data
+ */
+ extern int utf8_next(
+#ifdef __STDC__
+ const char** pcursor,
+ const char* end
+#endif
+ );
#ifdef __cplusplus
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.3.7/src/ftbench.c new/ft2demos-2.3.9/src/ftbench.c
--- old/ft2demos-2.3.7/src/ftbench.c 2007-02-12 23:09:07.000000000 +0100
+++ new/ft2demos-2.3.9/src/ftbench.c 2009-03-11 06:38:11.000000000 +0100
@@ -2,7 +2,7 @@
/* */
/* The FreeType project -- a free and portable quality TrueType renderer. */
/* */
-/* Copyright 2002, 2003, 2004, 2005, 2006 by */
+/* Copyright 2002, 2003, 2004, 2005, 2006, 2009 by */
/* D. Turner, R.Wilhelm, and W. Lemberg */
/* */
/* ftbench: bench some common FreeType call paths */
@@ -21,7 +21,7 @@
#include FT_CACHE_IMAGE_H
#include FT_CACHE_SMALL_BITMAPS_H
#include FT_SYNTHESIS_H
-
+#include FT_ADVANCES_H
#ifdef UNIX
#include
@@ -74,6 +74,7 @@
enum {
FT_BENCH_LOAD_GLYPH,
+ FT_BENCH_LOAD_ADVANCES,
FT_BENCH_RENDER,
FT_BENCH_GET_GLYPH,
FT_BENCH_GET_CBOX,
@@ -225,6 +226,31 @@
int
+test_load_advances( btimer_t* timer,
+ FT_Face face,
+ void* user_data )
+{
+ int done = 0;
+ FT_Fixed* advances;
+ FT_ULong flags = *((FT_ULong*)user_data);
+
+
+ advances = (FT_Fixed *)calloc( sizeof ( FT_Fixed ), face->num_glyphs );
+
+ TIMER_START( timer );
+
+ FT_Get_Advances( face, 0, face->num_glyphs, flags, advances );
+ done += face->num_glyphs;
+
+ TIMER_STOP( timer );
+
+ free( advances );
+
+ return done;
+}
+
+
+int
test_render( btimer_t* timer,
FT_Face face,
void* user_data )
@@ -735,7 +761,8 @@
for ( i = 0; i < N_FT_BENCH; i++ )
{
- btest_t test;
+ btest_t test;
+ FT_ULong flags;
if ( !TEST( 'a' + i ) )
@@ -766,6 +793,19 @@
benchmark( face, &test, max_iter, max_time );
}
break;
+ case FT_BENCH_LOAD_ADVANCES:
+ test.user_data = &flags;
+
+ test.title = "Load_Advances (Normal)";
+ test.bench = test_load_advances;
+ flags = FT_LOAD_DEFAULT;
+ benchmark( face, &test, max_iter, max_time );
+
+ test.title = "Load_Advances (Fast)";
+ test.bench = test_load_advances;
+ flags = FT_LOAD_TARGET_LIGHT;
+ benchmark( face, &test, max_iter, max_time );
+ break;
case FT_BENCH_RENDER:
test.title = "Render";
test.bench = test_render;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.3.7/src/ftcommon.c new/ft2demos-2.3.9/src/ftcommon.c
--- old/ft2demos-2.3.7/src/ftcommon.c 2008-05-13 12:18:24.000000000 +0200
+++ new/ft2demos-2.3.9/src/ftcommon.c 2009-03-04 00:18:17.000000000 +0100
@@ -2,7 +2,7 @@
/* */
/* The FreeType project -- a free and portable quality TrueType renderer. */
/* */
-/* Copyright 2005, 2006, 2007, 2008 by */
+/* Copyright 2005, 2006, 2007, 2008, 2009 by */
/* D. Turner, R.Wilhelm, and W. Lemberg */
/* */
/* */
@@ -19,6 +19,7 @@
#include FT_BITMAP_H
+#include "common.h"
#include "ftcommon.h"
#include
@@ -1018,58 +1019,27 @@
void
- FTDemo_String_Set( FTDemo_Handle* handle,
- const unsigned char* string )
+ FTDemo_String_Set( FTDemo_Handle* handle,
+ const char* string )
{
- const unsigned char* p = string;
- unsigned long codepoint;
- unsigned char in_code;
- int expect;
- PGlyph glyph = handle->string;
+ const char* p = string;
+ const char* end = p + strlen( string );
+ unsigned long codepoint;
+ int ch;
+ int expect;
+ PGlyph glyph = handle->string;
handle->string_length = 0;
codepoint = expect = 0;
- while ( *p )
+ for (;;)
{
- in_code = *p++ ;
-
- if ( in_code >= 0xC0 )
- {
- if ( in_code < 0xE0 ) /* U+0080 - U+07FF */
- {
- expect = 1;
- codepoint = in_code & 0x1F;
- }
- else if ( in_code < 0xF0 ) /* U+0800 - U+FFFF */
- {
- expect = 2;
- codepoint = in_code & 0x0F;
- }
- else if ( in_code < 0xF8 ) /* U+10000 - U+10FFFF */
- {
- expect = 3;
- codepoint = in_code & 0x07;
- }
- continue;
- }
- else if ( in_code >= 0x80 )
- {
- --expect;
-
- if ( expect >= 0 )
- {
- codepoint <<= 6;
- codepoint += in_code & 0x3F;
- }
- if ( expect > 0 )
- continue;
+ ch = utf8_next( &p, end );
+ if ( ch < 0 )
+ break;
- expect = 0;
- }
- else /* ASCII, U+0000 - U+007F */
- codepoint = in_code;
+ codepoint = ch;
if ( handle->encoding != FT_ENCODING_NONE )
glyph->glyph_index = FTDemo_Get_Index( handle, codepoint );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.3.7/src/ftcommon.h new/ft2demos-2.3.9/src/ftcommon.h
--- old/ft2demos-2.3.7/src/ftcommon.h 2007-05-29 00:19:24.000000000 +0200
+++ new/ft2demos-2.3.9/src/ftcommon.h 2009-03-04 00:17:52.000000000 +0100
@@ -2,7 +2,7 @@
/* */
/* The FreeType project -- a free and portable quality TrueType renderer. */
/* */
-/* Copyright 2005, 2006 by */
+/* Copyright 2005, 2006, 2009 by */
/* D. Turner, R.Wilhelm, and W. Lemberg */
/* */
/* */
@@ -309,8 +309,8 @@
/* set the string to be drawn */
void
- FTDemo_String_Set( FTDemo_Handle* handle,
- const unsigned char* string );
+ FTDemo_String_Set( FTDemo_Handle* handle,
+ const char* string );
/* draw a string centered at (center_x, center_y) -- */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.3.7/src/ftdiff.c new/ft2demos-2.3.9/src/ftdiff.c
--- old/ft2demos-2.3.7/src/ftdiff.c 2008-05-18 23:52:18.000000000 +0200
+++ new/ft2demos-2.3.9/src/ftdiff.c 2009-01-07 09:16:41.000000000 +0100
@@ -2,7 +2,7 @@
/* */
/* The FreeType project -- a free and portable quality TrueType renderer. */
/* */
-/* Copyright 2007, 2008 by */
+/* Copyright 2007, 2008, 2009 by */
/* D. Turner, R.Wilhelm, and W. Lemberg */
/* */
/* */
@@ -145,6 +145,7 @@
int use_kerning;
int use_deltas;
int use_lcd_filter;
+ int use_global_advance_width;
FT_LcdFilter lcd_filter;
HintMode hint_mode;
DisplayMode disp_mode;
@@ -197,16 +198,17 @@
state->char_size = 16;
state->display = display[0];
- state->columns[0].use_kerning = 1;
- state->columns[0].use_deltas = 1;
- state->columns[0].use_lcd_filter = 1;
- state->columns[0].lcd_filter = FT_LCD_FILTER_DEFAULT;
- state->columns[0].hint_mode = HINT_MODE_BYTECODE;
+ state->columns[0].use_kerning = 1;
+ state->columns[0].use_deltas = 1;
+ state->columns[0].use_lcd_filter = 1;
+ state->columns[0].use_global_advance_width = 1;
+ state->columns[0].lcd_filter = FT_LCD_FILTER_DEFAULT;
+ state->columns[0].hint_mode = HINT_MODE_BYTECODE;
- state->columns[1] = state->columns[0];
+ state->columns[1] = state->columns[0];
state->columns[1].hint_mode = HINT_MODE_AUTOHINT;
- state->columns[2] = state->columns[0];
+ state->columns[2] = state->columns[0];
state->columns[2].hint_mode = HINT_MODE_UNHINTED;
state->col = 2;
@@ -440,6 +442,9 @@
if ( rmode == HINT_MODE_UNHINTED )
load_flags |= FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP;
+ if ( !column->use_global_advance_width )
+ load_flags |= FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
+
for ( ; *p; p++ )
{
FT_UInt gindex;
@@ -589,10 +594,13 @@
}
state->display.disp_text( disp, left, bottom + 15, msg );
- sprintf(temp, "%s / %s",
- column->use_kerning ? "kerning" : "no kerning",
- column->use_deltas ? "deltas" : "no deltas" );
- msg = column->use_kerning ? "use kerning" : "no kerning";
+ sprintf(temp, "%s %s %s",
+ column->use_kerning ? "+kern"
+ : "-kern",
+ column->use_deltas ? "+delta"
+ : "-delta",
+ column->use_global_advance_width ? "+advance"
+ : "-advance" );
state->display.disp_text( disp, left, bottom + 25, temp );
if ( state->col == idx )
@@ -795,11 +803,12 @@
grWriteln( " v : decrease gamma by 0.1" );
grLn();
grWriteln( " 1-3 : change currently selected column" );
- grWriteln( " k : toggle kerning" );
+ grWriteln( " a : toggle `ignore global advance width flag" );
grWriteln( " d : toggle lsb/rsb deltas" );
grWriteln( " h : toggle hinting mode" );
- grWriteln( " r : toggle rendering mode" );
+ grWriteln( " k : toggle kerning" );
grWriteln( " l : change LCD filter type" );
+ grWriteln( " r : toggle rendering mode" );
grWriteln( " Up : increase pointsize by 0.5 unit" );
grWriteln( " Down : decrease pointsize by 0.5 unit" );
grWriteln( " Page Up : increase pointsize by 5 units" );
@@ -880,11 +889,43 @@
sprintf( state->message0, "column %d selected", state->col + 1 );
break;
- case grKEY( 'k' ):
- column->use_kerning = !column->use_kerning;
- state->message = column->use_kerning
- ? (char *)"using kerning"
- : (char *)"ignoring kerning";
+ case grKeyUp:
+ event_change_size( state, +0.5 );
+ break;
+
+ case grKeyDown:
+ event_change_size( state, -0.5 );
+ break;
+
+ case grKeyPageUp:
+ event_change_size( state, +5. );
+ break;
+
+ case grKeyPageDown:
+ event_change_size( state, -5. );
+ break;
+
+ case grKEY( '1' ):
+ state->col = 0;
+ state->message = (char *)"column 1 selected";
+ break;
+
+ case grKEY( '2' ):
+ state->col = 1;
+ state->message = (char *)"column 2 selected";
+ break;
+
+ case grKEY( '3' ):
+ state->col = 2;
+ state->message = (char *)"column 3 selected";
+ break;
+
+ case grKEY( 'a' ):
+ column->use_global_advance_width
+ = !column->use_global_advance_width;
+ state->message = column->use_global_advance_width
+ ? (char *)"using global advance width"
+ : (char *)"ignoring global advance width";
break;
case grKEY( 'd' ):
@@ -894,6 +935,25 @@
: (char *)"ignoring rsb/lsb deltas";
break;
+ case grKEY( 'g' ):
+ event_change_gamma( state, +0.1 );
+ break;
+
+ case grKEY( 'h' ):
+ column->hint_mode =
+ (HintMode)( ( column->hint_mode + 1 ) % HINT_MODE_MAX );
+ state->message = state->message0;
+ sprintf( state->message0, "column %d is %s",
+ state->col + 1, render_mode_names[column->hint_mode] );
+ break;
+
+ case grKEY( 'k' ):
+ column->use_kerning = !column->use_kerning;
+ state->message = column->use_kerning
+ ? (char *)"using kerning"
+ : (char *)"ignoring kerning";
+ break;
+
case grKEY( 'l' ):
switch ( column->lcd_filter )
{
@@ -922,27 +982,12 @@
}
break;
- case grKEY( '1' ):
- state->col = 0;
- state->message = (char *)"column 1 selected";
- break;
-
- case grKEY( '2' ):
- state->col = 1;
- state->message = (char *)"column 2 selected";
- break;
-
- case grKEY( '3' ):
- state->col = 2;
- state->message = (char *)"column 3 selected";
+ case grKEY( 'n' ):
+ render_state_set_file( state, state->face_index + 1 );
break;
- case grKEY( 'h' ):
- column->hint_mode =
- (HintMode)( ( column->hint_mode + 1 ) % HINT_MODE_MAX );
- state->message = state->message0;
- sprintf( state->message0, "column %d is %s",
- state->col + 1, render_mode_names[column->hint_mode] );
+ case grKEY( 'p' ):
+ render_state_set_file( state, state->face_index - 1 );
break;
case grKEY( 'r' ):
@@ -953,38 +998,10 @@
: "gray rendering" );
break;
- case grKEY( 'n' ):
- render_state_set_file( state, state->face_index + 1 );
- break;
-
- case grKEY( 'p' ):
- render_state_set_file( state, state->face_index - 1 );
- break;
-
- case grKEY( 'g' ):
- event_change_gamma( state, +0.1 );
- break;
-
case grKEY( 'v' ):
event_change_gamma( state, -0.1 );
break;
- case grKeyUp:
- event_change_size( state, +0.5 );
- break;
-
- case grKeyDown:
- event_change_size( state, -0.5 );
- break;
-
- case grKeyPageUp:
- event_change_size( state, +5. );
- break;
-
- case grKeyPageDown:
- event_change_size( state, -5. );
- break;
-
default:
break;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.3.7/src/ftgrid.c new/ft2demos-2.3.9/src/ftgrid.c
--- old/ft2demos-2.3.7/src/ftgrid.c 2007-07-07 08:08:12.000000000 +0200
+++ new/ft2demos-2.3.9/src/ftgrid.c 2009-03-11 06:42:57.000000000 +0100
@@ -2,7 +2,7 @@
/* */
/* The FreeType project -- a free and portable quality TrueType renderer. */
/* */
-/* Copyright 1996-2000, 2003, 2004, 2005, 2006, 2007 by */
+/* Copyright 1996-2000, 2003, 2004, 2005, 2006, 2007, 2009 by */
/* D. Turner, R.Wilhelm, and W. Lemberg */
/* */
/* */
@@ -52,9 +52,15 @@
int _af_debug_disable_blue_hints;
AF_GlyphHints _af_debug_hints;
+#ifdef __cplusplus
+ extern "C" {
+#endif
extern void af_glyph_hints_dump_segments( AF_GlyphHints hints );
extern void af_glyph_hints_dump_points( AF_GlyphHints hints );
extern void af_glyph_hints_dump_edges( AF_GlyphHints hints );
+#ifdef __cplusplus
+ }
+#endif
typedef struct status_
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.3.7/src/ftstring.c new/ft2demos-2.3.9/src/ftstring.c
--- old/ft2demos-2.3.7/src/ftstring.c 2007-05-11 22:41:30.000000000 +0200
+++ new/ft2demos-2.3.9/src/ftstring.c 2009-03-04 00:15:19.000000000 +0100
@@ -2,7 +2,7 @@
/* */
/* The FreeType project -- a free and portable quality TrueType renderer. */
/* */
-/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007 by */
+/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */
/* D. Turner, R.Wilhelm, and W. Lemberg */
/* */
/* */
@@ -135,7 +135,7 @@
FTDemo_Set_Current_Charsize( handle, status.ptsize, status.res );
FTDemo_Update_Current_Flags( handle );
- FTDemo_String_Set( handle, (unsigned char*)Text );
+ FTDemo_String_Set( handle, Text );
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2demos-2.3.7/src/ftview.c new/ft2demos-2.3.9/src/ftview.c
--- old/ft2demos-2.3.7/src/ftview.c 2007-12-29 22:50:11.000000000 +0100
+++ new/ft2demos-2.3.9/src/ftview.c 2009-03-04 00:06:59.000000000 +0100
@@ -2,7 +2,7 @@
/* */
/* The FreeType project -- a free and portable quality TrueType renderer. */
/* */
-/* Copyright 1996-2000, 2003, 2004, 2005, 2006, 2007 by */
+/* Copyright 1996-2000, 2003, 2004, 2005, 2006, 2007, 2009 by */
/* D. Turner, R.Wilhelm, and W. Lemberg */
/* */
/* */
@@ -409,7 +409,8 @@
int i;
FT_Size size;
- const unsigned char* p;
+ const char* p;
+ const char* pEnd;
num_indices = num_indices; /* pacify compiler */
@@ -425,20 +426,25 @@
i = first_index;
- p = Text;
+ p = (const char*)Text;
+ pEnd = p + strlen( (const char*)Text );
- while ( i > 0 && *p )
+ while ( i > 0 )
{
- p++;
+ utf8_next( &p, pEnd );
i--;
}
- while ( *p && num_indices != 0 )
+ while ( num_indices != 0 )
{
FT_UInt gindex;
+ int ch;
+ ch = utf8_next( &p, pEnd );
+ if ( ch < 0 )
+ break;
- gindex = FTDemo_Get_Index( handle, *p );
+ gindex = FTDemo_Get_Index( handle, ch );
error = FTDemo_Draw_Index( handle, display, gindex, &x, &y );
if ( error )
@@ -458,8 +464,6 @@
}
}
- p++;
-
if ( num_indices > 0 )
num_indices -= 1;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org