vertical text, characters too close to each other lazarus / 39-Graphics ---------------------------------------------------------------------- K.Bleijenberg · 2014-01-17 10:23 I'am using aggpas to draw a png in a command line tool (no dependency's on GDI or X11). I need to draw vertical text. In code I do: agg^.font(fontFilePath,fontSize ,false,false,vectorFontCache,deg2rad(90)); agg is an instance of TAgg2D and fontfilepath is '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf' The output is not what I want. The characters are too close to each other (see attachment). The size of the horizontal font is equal to the vertical font. What can I do stretch the string? Kees ---------------------------------------------------------------------- engkin · 2014-01-17 15:06 QuoteThe size of the horizontal font is equal to the vertical font. Are you sure? They don't seem so, check the attached image. ---------------------------------------------------------------------- K.Bleijenberg · 2014-01-19 11:03 Quote from: engkin on January 17, 2014, 04:06:18 pmQuoteThe size of the horizontal font is equal to the vertical font. Are you sure? They don't seem so, check the attached image. Yes I' am sure. I've investigated it further and more strange things happen: I tried this       with agg^ do       begin          fillColor(255,255,255);          rectangle(0,imageHeight-1,imageWidth-1,0);          fillColor(0,0,0);          lineColor(0,0,0);          font(fontFilePath,30,false,false,VectorFontCache);          text(10,10,char_ptr('Blah'));          font(fontFilePath,30,true,true,VectorFontCache);          text(100,100,char_ptr('Blah')); The first and second Blah look exactly the same. To me they are both bold and the second blah is definitely not italic. if I run         font(fontFilePath,30);          text(10,10,char_ptr('Blah'));          font(fontFilePath,30,true,true);          text(100,100,'Blah'); Both blah's seems not bold and  not italic. ---------------------------------------------------------------------- engkin · 2014-01-19 15:50 Your problem is with the lineColor(0,0,0);. The default value is 255 for the alpha channel. Just change it to 0: Code: [Select]  lineColor(0,0,0,0); Check the attached images. Both show increasing alpha values for the green line color. The first one has 255 for the alpha value of the red fill color, while the second image has 0 for the alpha value of the fill color. A letter B in the sample text denotes bold font, and a letter I for italic font. ---------------------------------------------------------------------- K.Bleijenberg · 2014-01-20 16:51 Quote from: engkin on January 19, 2014, 04:50:59 pmYour problem is with the lineColor(0,0,0);. The default value is 255 for the alpha channel. Just change it to 0: Code: [Select]  lineColor(0,0,0,0); Check the attached images. Both show increasing alpha values for the green line color. The first one has 255 for the alpha value of the red fill color, while the second image has 0 for the alpha value of the fill color. A letter B in the sample text denotes bold font, and a letter I for italic font. The linecolor was indeed the problem. The overlapping characters came from too much line width. Sometimes the problem was obscured by a wrong alpha value. Thanks! Kees ---------------------------------------------------------------------- Graeme · 2014-08-06 06:13 I know this is an old post, but I thought posting the correct answer might help others in future. Quote from: K.Bleijenberg on January 19, 2014, 12:03:38 pm      with agg^ do       begin          fillColor(255,255,255);          rectangle(0,imageHeight-1,imageWidth-1,0);          fillColor(0,0,0);          lineColor(0,0,0);          font(fontFilePath,30,false,false,VectorFontCache);          text(10,10,char_ptr('Blah')); ...snip... The first and second Blah look exactly the same. To me they are both bold... Remember that AggPas is a vector based drawing library - so too for fonts. So drawing effects can be applied to fonts too - in this case drawing with an outline color. In the above code you are defining a text outline as well as a text fill color. So that is what makes the Bold and "fatter" effect. Maybe what you are looking for is just the text fill, without outlining the text. eg: Code: [Select]    agg.FillColor(c1);     agg.NoLine;  // don't outline the text     agg.text(10,10,char_ptr('Blah')); This will give you thinner text output.