Embedded inline graphics and SVG ?
I pick this up from the announcement of Xara Designer 8.
This is a great feature but I don't know if this is compatible with svg. Freehand had it already a long time ago, and DTP programs like QuarkXPress also (but the later can also embed bitmap images on text lines, which is a must !)
" Designer MX now allows you to embed 'inline graphics' in text using a simple Paste operation. Embedded graphics are great for really small items on the line such as symbols, icons etc, and are treated just like a 'character', in other words they flow and follow the same formatting rules as a character embedded in the text. "
ivan
What objects/methods would one extract the list of character widths (kerns?) for a text string starting from its Style? Basically what I'm looking for is just the widths in pixels along the line for each character in the string. Here is an example pulled out of an EMF made on Windows:
One line of Arial (45 px)
had widths
700,501,501,250,200,200,501,501,250,501,250,250,600,300,200,501,200,250,300,501,501,250,501,450,300
(That is, "l" and "i" are width 200, "O" is 700.)
In this example those widths were determined by GDI subsequent to a TextOutW() call with the string. That method won't work for the EMF implementation I'm working on for Linux/Mac because there the "graphics device context" doesn't actually have anything like a rendering of the object, so the information must be provided by Inkscape (and ExtTextOutW used instead of TextOutW).
Alternatively, since the font height, weight, and face are known, something like this would work as well:
width_of_char('l',"bold","Arial",45); // returns 200, as per example above
where 45 is the font height and the rest is self explanatory. Except I have no idea what function this would be either.
Thanks,
David Mathog mathog@...1176... Manager, Sequence Analysis Facility, Biology Division, Caltech
On Tue, 2012-05-29 at 16:31 -0700, mathog wrote:
What objects/methods would one extract the list of character widths (kerns?) for a text string starting from its Style?
You can create a text box and grab it's bounding box, which should be roughly the width of drawing needed. If you're just looking for the number on a non-canvas related way you can use Pango. Here's some code that does that in indicator-datetime:
http://bazaar.launchpad.net/~indicator-applet-developers/indicator-datetime/...
We're getting the font description from the GTK Style, but you could build your own as well.
--Ted
participants (3)
-
Ivan Louette
-
mathog
-
Ted Gould