Mattias Gaertner wrote:
On Sun, 07 May 2006 00:28:23 +0200 darekm <[EMAIL PROTECTED]> wrote:Hi My patchworks 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 colorAbout: + 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.
I was think that 10 is default size, where I can find out it.
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) ?
if lfHeight=0 then use default (this part work only for lfHeight<>0)
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. I only divide sorce to GTK and GTK2, I want to remove IFDEF
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?
in XLFD size of font is multiply by 10, and we need return 0 when size is not set
MattiasDarek 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 gtk2Just 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.Jesus Reyes wrote:FontNameToPangoDescription should not be part of LCL (graphics), its only part of GTK2 widgetSet--- 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?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.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 conditionalI was planning to not include that, the patch was not intended to apply as is.and what for FHeightFloatIf 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 :)DarekJesus 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
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
