On Sun, 07 May 2006 00:28:23 +0200
darekm <[EMAIL PROTECTED]> wrote:

> Hi
>  My patch
>    works better with size of font and font with XLFD name (see Tony Maro 
> mail)
>    distinguish GTK1 from GTK2 on utf8 draw text
>    better works with color

About:
+      if (aSize=0)  then FullString:='10'
+                    else FullString:=IntToStr(aSize);

The 10 is not the default size. Please add always a comment that it is a
ToDo to fetch the default font size.


About:
-        aSize:= (abs(lfheight) * 72) div ScreenInfo.PixelsPerInchX;
-        if aSize=0 then
-          aSize := 12;
+        if lfHeight<0 then
+          aSize:= (abs(lfheight) * 72) div ScreenInfo.PixelsPerInchX
+        else
+          aSize:=lfHeight;
+        pango_font_description_set_size( GdiObject^.GD
 
Shouldn't that be "lfHeight <= 0" (lower or equal) ?


About:
+function TGTK2WidgetSet.FontCanUTF8(Font: HFont): boolean;
+begin
+  Result:=IsValidGDIObject(Font) and
+
FontIsDoubleByteCharsFont(gdk_font_from_description(PGdiObject(Font)^.GDIFo
ntObject));
+end;

This is a mem leak. see gdk_font_from_description.


About:
-    aSize := StrToIntDef(ExtractXLFDItem(LongFontName, XLFD_POINTSIZE),12);
+    aSize := StrToIntDef(ExtractXLFDItem(LongFontName, XLFD_POINTSIZE),0)
div 10;

Why is the size now ten times as big?


Mattias



> Darek
> 
> Jesús Reyes A. wrote:
> 
> >
> > ----- Original Message ----- From: "darekm" <[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Friday, April 28, 2006 10:23 AM
> > Subject: Re: [lazarus] [patch] textOut on gtk2
> >
> >
> >> Jesus Reyes wrote:
> >>
> >>> --- darekm <[EMAIL PROTECTED]> escribió:
> >>>
> >>>
> >>>> Hi
> >>>>  textOut once more
> >>>>
> >>>>  and
> >>>>  clipping (sometimes buttons are not refresh after tHint disappear
> >>>>
> >>>>
> >>>> Darek
> >>>>
> >>>>
> >>>>
> >>>
> >>> [snip]
> >>>
> >>> I also have a patch for GTK2 CreateFontIndirectEx, I simplified the
> >>> function a little and added support for font names like "helvetica
> >>> 12" in addition to XLFD and single font names. Comments?
> >>>
> >> FontNameToPangoDescription should not be part of LCL (graphics), its 
> >> only part of GTK2 widgetSet
> >>
> >
> > Just like the other XLFD auxiliary methods around there, one may argue 
> > that they are specific to gtk*, however, is not the location of the 
> > function that is interesting but the functionality.
> >
> >>
> >>> One observation for Darek's patch, it seems that to convert font's
> >>> pixel size to point size a fixed 96 ppi was used, why not to use
> >>> ScreenInfo.PixelsPerInchX (or Y)?
> >>>
> >> We can write not only to screen.
> >> We need new function of pango, that use pixel size (as I write, I 
> >> think that when we start use GTK2 in production application it will 
> >> be standard)
> >> it can be done by conditional
> >>
> >
> > I made the question because I thought that there might be a reason for 
> > using a fixed value. I'm sure that if necesary we will find the way to 
> > handle other devices properly, at the moment ScreenInfo.PixelsPerInchX 
> > seems to me like a more appropiated value.
> >
> >> and what for FHeightFloat
> >>
> >
> > I was planning to not include that, the patch was not intended to 
> > apply as is.
> >
> > If nobody oppose, I will apply the patch tomorrow when I will have 
> > access to the linux pc, then if you like to make some changes, as 
> > always, patches are welcome :)
> >
> >> Darek
> >>
> >>
> >
> > Jesus Reyes A.
> >
> > __________________________________________________
> > Correo Yahoo!
> > Espacio para todos tus mensajes, antivirus y antispam __gratis! 
> > Regístrate ya - http://correo.yahoo.com.mx/
> > _________________________________________________________________
> >     To unsubscribe: mail [EMAIL PROTECTED] with
> >                "unsubscribe" as the Subject
> >   archives at http://www.lazarus.freepascal.org/mailarchives
> >
> 

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to