xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Text layout with Batik
Date Fri, 08 Aug 2008 09:58:47 GMT
Hi Vossler,

Vossler T <vosslertw@gmail.com> wrote on 08/08/2008 02:54:52 AM:

> why css's font don;t work correctly?

    Well I think they do...

> I changed font to , of course I did put that font in 
D:\Java\jre6\lib\fonts´╝î 
> but everytime textflow only convert to system default's font such as 
arial.

   Well first I'm not sure what you changed font to since it seems to have
gotten lost.  Second there is a chance that the font is in a format that 
Java 
doesn't support (i.e. anything but TrueType?).  Third to be honest I'm not 
sure how java 
adds fonts to it's list of platform fonts (so just adding it to lib/fonts 
might 
not be enough).  I typically point the SVG directly at the font with 
something 
like (taken from samples/tests/spec/fonts/fontFace.svg):

    @font-face { font-family: "CSS Batik TrueType"; 
                 src: url(../../resources/ttf/glb12.ttf); }

   I hope that helps.

> Cameron McCormack-4 wrote:
> > 
> > Hi Andy.
> > 
> > Andy Hall:
> >> I'm currently writing a small Java tool for generating SVG files from 
 
> >> a set of data.  At the moment I have am generating the SVG in a 
> >> rather naive way, by sticking data values into a SVG template, which 
> >> works well enough for the structures I'm generating.  However I will 
> >> need to add text to the images, more specifically variable length 
> >> lines of text.  I require this text to be word wrapped within a 
> >> defined area and for separate blocks of text to be stacked on top of 
> >> each other.
> >> 
> >> I've been planning on using Batik's swing component for the purpose 
> >> of previewing these images, but I was wondering if I would be able to 
 
> >> solve my text problem with Batik's other components.
> >> 
> >> I'd be really grateful if someone could point me in the right 
direction.
> > 
> > You have two choices for laying out text in SVG.  The first is to 
write
> > some script that will determine the linebreaks and lay out the text
> > manually.  For a greedy text layout (try to put the next word on the
> > line, and if it overflows the desired maximum line width, put a line
> > break there) this is not too hard.  This will be compatible with other
> > SVG 1.1 implementations.
> > 
> > Alternatively, you can use Batik?s flowText support.  Here?s an 
example:
> > 
> > 
> > http://svn.apache.
> 
org/repos/asf/xmlgraphics/batik/trunk/samples/tests/spec12/text/flowText.svg
> > 
> > Note that this syntax for flowing text comes from a draft of SVG 1.2
> > Full, which will likely change at some point.
> > 
> > Cameron
> > 
> > -- 
> > Cameron McCormack, http://mcc.id.au/
> >    xmpp:heycam@jabber.org  ?  ICQ 26955922  ?  MSN cam@mcc.id.au
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Text-layout-
> with-Batik-tp8928258p18886594.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 

Mime
View raw message