Dave Crossland | 17 Nov 18:25
Gravatar

New FontForge build that depends on Pango has slow startup time

Hi,

FontForge now uses Pango for its UI text by default!

I wonder if any Pango experts could take a quick look at this and help
GWW to diagnose what is making FontForge startup very slow?

---------- Forwarded message ----------
From:  <gww <at> silcom.com>
Date: 2008/11/16
Subject: [Fontforge-announce] New FontForge build
To: fontforge-announce <at> lists.sf.net

First release with Pango and Cairo.

The first time you run fontforge with Pango something takes several
minutes to initialize itself. This delay does not occur on subsequent
invocations.

The version of Cairo available from fink on the mac is so old that
FontForge can't use it. The default fontconfig setup on the mac does
not seem to find any outline fonts (reverting to bitmaps). Create a
~/.fonts directory yourself, and put some fonts there.

Pango crashes on my cygwin system, so the cygwin build does not
contain either Pango or Cairo.
Jeremy Smith | 13 Nov 21:20
Favicon

Pango/Cairo with OpenType handling

I'm trying to figure out how to use the OpenType font handling functions 
as described here:
<http://library.gnome.org/devel/pango/unstable/pango-OpenType-Font-Handling.html>

The problem is that in order to do anything with OpenType, I first need 
to get a PangoOTInfo.  I can only get a PangoOTInfo if I have an 
FT_Face, which is specific to FreeType.  I want to use Cairo as the 
backend.  Is this possible?  I can't seem to figure out any way of 
getting a valid FT_Face without using FreeType or Xft.

If anyone could just tell me the simplest way to get an FT_Face, that 
would be perfect.  I've tried using pango_font_map_load_font() to get a 
PangoFont, then passing that to pango_ft2_font_get_face() (which is 
deprecated), but I get a warning about how the font is not valid:

Pango-WARNING **: pango_ft2_font_get_face called with bad font, expect 
ugly output

So clearly I'm doing something wrong.

Thanks for any advice (I'm brand new to using Pango, as you can probably 
tell)
Jeremy
Sebastian Bauer | 12 Nov 14:41

Leak in the pango cairo example?

Hello,

currently I'm playing a little bit around with pango. However, in my
application I get a memory leak which, by using valgrind, could be addressed
to pango, in particular, to the pango_layout_get_size() function. Therefore I
tried the cairo example, as provided at
http://library.gnome.org/devel/pango/unstable/pango-Cairo-Rendering.html in
order to check, whether my code is wrong.

However, even with Example 1 that is listed there, I get those leaks. You'll
find the output of valgrind attached to this mail. Is there anything that can
be done about the leaks?

I'm using pango 1.20.5.

Any help is appreciated! Thanks in advance!

Best,
Sebastian
Attachment (pango.out): application/octet-stream, 5419 bytes
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list <at> gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Isenko Evgeny | 10 Nov 07:47

Problem using Pango with .Net

Hello!

When using Pango in C# (MS Visual Studio), I encountered several strange
problems that I cannot explain. It is 80% sure that I've made some
mistake implementing Pango binding for C#. Does anyone has such experience?

The following code works fine until I try to make some special changes.
In particular, there are two problems.

1) pango_font_description_set_size doesn't work.
Moreover, whenever I try to call this method, boxes appear instead of
letters.
The funny thing is that pango_font_description_from_string works fine.
At present, I change font size by putting needed value into the string
parameter. :-)

2) Whenever I try to call pango_matrix_rotate, boxes appear instead of
letters. Also, pango_context_set_matrix doesn't seem to work.

(The below code is simplified a little bit for readability).

// This is how I implemented some dll bindings
[DllImport(pango)]
public static extern void pango_matrix_rotate(
[In, MarshalAs(UnmanagedType.LPStruct)]
PangoMatrix pango_matrix,
double degrees);

[DllImport(pango)]
public static extern void pango_context_set_matrix(
(Continue reading)

Isenko Evgeny | 4 Nov 09:04

Using Pango in C#: encoding problem

Hello!

I'm trying to use Pango in C# (MS Visual Studio), but cannot figure out
how to convert C# strings to the native Pango format (char*) and vice
versa. The non-unicode letters are drawn without problems, but when I
try to put some unicode text, the output is unreadable.

First of all, I confirmed that pango and cairo are working well. For
this I got the sample string with pango_language_get_sample_string and
put it in pango_layout_set_text. It was perfect for any language. But
when I try to convert it to the C# string, I get only unreadable mess.

Below is the code. Would someone tell me where I was wrong?

[DllImport("libpango-1.0-0.dll", CharSet = CharSet.Ansi)]
public static extern IntPtr pango_language_get_sample_string(IntPtr
language);

/* Some code here */

IntPtr samplePointer =
PangoCairo.NativeMethods.pango_language_get_sample_string(myLang);
string outputStr = Marshal.PtrToStringAnsi(samplePointer);

When I use Unicode instead of Ansi, the result becomes even worse...

Thanks for any help.

Evgeny
(Continue reading)

Wilfried Holzke | 29 Oct 20:01

Replace ellipsize character?

Hi,

Is it possible or planed to replace the ellipsize character(s) "..." to
another character for example "~"?

regards

  W. Holzke
Wilfried Holzke | 26 Oct 09:49

Text size, height ascent, descent documentation

Hi,

I am searching for a documentation on how to set the size of text to get
for example a text of 20 pixels height on screen. Further on I am
searching for information how to get the ascent and descent values.

Thanks for hints and help.

regards

  Wilfried
Tony Graham | 24 Oct 12:01

FYI: "Requirements of Japanese Text Layout" W3C Working Draft

FYI, the W3C has a working draft of "Requirements of Japanese Text
Layout" available at http://www.w3.org/TR/2008/WD-jlreq-20081015/

The task force is looking for feedback (to www-i18n-comments <at> w3.org) by
15 November 2008.

Regards,

Tony Graham                         Tony.Graham <at> MenteithConsulting.com
Director                                  W3C XSL FO SG Invited Expert
Menteith Consulting Ltd
XML, XSL and XSLT consulting, programming and training
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
Registered in Ireland - No. 428599   http://www.menteithconsulting.com
  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
xmlroff XSL Formatter                               http://xmlroff.org
xslide Emacs mode                  http://www.menteith.com/wiki/xslide
Unicode: A Primer                               urn:isbn:0-7645-4625-2
Theo Veenker | 23 Oct 11:38

pango_cairo_update_layout()

Hi,

A question regarding pango_cairo_update_layout(). The example in
http://library.gnome.org/devel/pango/stable/pango-Cairo-Rendering.html
contains the following fragment:

   for (i = 0; i < N_WORDS; i++)
     {
       int width, height;
       double angle = (360. * i) / N_WORDS;
       double red;

       cairo_save (cr);

       /* Gradient from red at angle == 60 to blue at angle == 240 */
       red   = (1 + cos ((angle - 60) * G_PI / 180.)) / 2;
       cairo_set_source_rgb (cr, red, 0, 1.0 - red);

       cairo_rotate (cr, angle * G_PI / 180.);

       /* Inform Pango to re-layout the text with the new transformation */
       pango_cairo_update_layout (cr, layout);

       pango_layout_get_size (layout, &width, &height);
       cairo_move_to (cr, - ((double)width / PANGO_SCALE) / 2, - RADIUS);
       pango_cairo_show_layout (cr, layout);

       cairo_restore (cr);
     }

(Continue reading)

Theo Veenker | 22 Oct 21:54

PangoCairoFontMap resolution

Hi all,

Suppose I'm writing a text on two displays (using the same font face).
Display 1 has a resolution of 85 dpi and display 2 has a resultion of
100 dpi. I could create two fontmaps and for both set the desired
resolution using pango_cairo_font_map_set_resolution() and then
work with those.

But what if I would just create one fontmap (with default resolution
of 96 dpi) and draw the text (through cairo) with scale 85/96 on
display 1 and with scale 100/96 on display 2. Would this yield
the same result as with two dedicated fontmaps?

Theo

Non uniform scaling

Hi,

I was looking into how to non uniformly scale fonts with Pango, and it
seems that the only way is to use cairo_scale. This is not great, however,
as it means I have to keep track of that scale to scale other transforms
I do afterwards and other things like the width of a Pango layout when
calculating positions. This makes it very brittle and unnecessarily
complex to use.

A better way would be to get Pango to allow non uniform scale. I've
found the place in the Pango source where the scale is set, and it is in
_pango_cairo_fc_font_new (I haven't looked for other backends, but I'm
sure you'll find it faster than me). Here, the font matrix is scaled
uniformly by the font size, rather than two scales.

Would it be possible to expose a non uniform scale in the Pango API ?
Hopefully no backends would lack the ability to do that.

Thanks

Gmane