Re: [Retep-PDF] text alignment
Status: Beta
Brought to you by:
petermount
|
From: Peter M. <pe...@re...> - 2004-08-09 21:58:21
|
Sorry for the late reply. I started a new day job recently, and I've hardly been home since :-( Egon Reetz wrote: > I'm searching for a way to align text right justified (e.g. digits). > Is there a way to position text and writing from right to left or do I > have to use the AFM class to calculate the length for a particular > string with a specified font and font size? There's two ways. If using Java2D, then use FontMetric as you would normally, and calculate the text length. RetepPDF will automatically use the AFM class to calculate the correct sizes (PDF font's are slightly different from Java fonts - mainly due to Java using the systems fonts). The other is to use the AFM classes directly. You can use the source for GraphicsImpl to find out how. Peter |