In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Function for text size in pixels?
-
- Mensajes: 216
- Registrado: Dom Sep 23, 2007 11:08 pm
Function for text size in pixels?
What function do I use to measure the length in pixels of a string in a
particular font and fontsize? I have looked "everywhere" in different help
files, but can't find it.
Thanks,
Paal
particular font and fontsize? I have looked "everywhere" in different help
files, but can't find it.
Thanks,
Paal
-
- Mensajes: 216
- Registrado: Dom Sep 23, 2007 11:08 pm
Function for text size in pixels?
Typically, 2 minutes after posting the question I found at least on solution
in TFont:GetTextSize. But are there any *function* to call also (something
like GetTextSizeFromFont( cFontName, cTextToMeasure )?
Thanks,
Paal
in TFont:GetTextSize. But are there any *function* to call also (something
like GetTextSizeFromFont( cFontName, cTextToMeasure )?
Thanks,
Paal
-
- Mensajes: 216
- Registrado: Dom Sep 23, 2007 11:08 pm
Function for text size in pixels?
Typically, 2 minutes after posting the question I found at least on solution
in TFont:GetTextSize. But are there any *function* to call also (something
like GetTextSizeFromFont( cFontName, cTextToMeasure )?
Thanks,
Paal
in TFont:GetTextSize. But are there any *function* to call also (something
like GetTextSizeFromFont( cFontName, cTextToMeasure )?
Thanks,
Paal
- ignacio
- Site Admin
- Mensajes: 9469
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Function for text size in pixels?
Paal,
Is the correct function. Your function prototype is not valid since it does
not take care of font size or bold state.
BTW, you can also use TCanvas:TextExtent()
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Mahanimann" <paaldalen@gmail.com> escribió en el mensaje
news:[email=47176503@ozsrv2.ozlan.local...]47176503@ozsrv2.ozlan.local...[/email]
> Typically, 2 minutes after posting the question I found at least on
> solution in TFont:GetTextSize. But are there any *function* to call also
> (something like GetTextSizeFromFont( cFontName, cTextToMeasure )?
>
> Thanks,
> Paal
>
Is the correct function. Your function prototype is not valid since it does
not take care of font size or bold state.
BTW, you can also use TCanvas:TextExtent()
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Mahanimann" <paaldalen@gmail.com> escribió en el mensaje
news:[email=47176503@ozsrv2.ozlan.local...]47176503@ozsrv2.ozlan.local...[/email]
> Typically, 2 minutes after posting the question I found at least on
> solution in TFont:GetTextSize. But are there any *function* to call also
> (something like GetTextSizeFromFont( cFontName, cTextToMeasure )?
>
> Thanks,
> Paal
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Function for text size in pixels?
Paal,
Is the correct function. Your function prototype is not valid since it does
not take care of font size or bold state.
BTW, you can also use TCanvas:TextExtent()
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Mahanimann" <paaldalen@gmail.com> escribió en el mensaje
news:[email=47176503@ozsrv2.ozlan.local...]47176503@ozsrv2.ozlan.local...[/email]
> Typically, 2 minutes after posting the question I found at least on
> solution in TFont:GetTextSize. But are there any *function* to call also
> (something like GetTextSizeFromFont( cFontName, cTextToMeasure )?
>
> Thanks,
> Paal
>
Is the correct function. Your function prototype is not valid since it does
not take care of font size or bold state.
BTW, you can also use TCanvas:TextExtent()
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Mahanimann" <paaldalen@gmail.com> escribió en el mensaje
news:[email=47176503@ozsrv2.ozlan.local...]47176503@ozsrv2.ozlan.local...[/email]
> Typically, 2 minutes after posting the question I found at least on
> solution in TFont:GetTextSize. But are there any *function* to call also
> (something like GetTextSizeFromFont( cFontName, cTextToMeasure )?
>
> Thanks,
> Paal
>
-
- Mensajes: 216
- Registrado: Dom Sep 23, 2007 11:08 pm
Function for text size in pixels?
>> (something like GetTextSizeFromFont( cFontName, cTextToMeasure )?
> Is the correct function. Your function prototype is not valid since it
> does
> not take care of font size or bold state.
Yes I forgot this wasn't Xbase++, there it would be: cFontName := "10.Arial
Bold"
> BTW, you can also use TCanvas:TextExtent()
Ok.
I have experimented and it's not enough to know the text width with a
certain font. I also need to know the system font DPI size set in the
Display properties -> Settings -> the General tab -> Display DPI Setting.
Please se the attached picture.
From Xbase++ I know that there is a function in USER32.DLL,
"GetSystemMetrics", parameter no. 30, which returns a value indicating the
DPI size. But I'm in the beginning of a learning process and for now I
would be very happy to avoid learning using DLL's and that kind of stuff.
Are there any ready made function available in (ok, or through) Xailer?
Regards,
Paal
Attached files
> Is the correct function. Your function prototype is not valid since it
> does
> not take care of font size or bold state.
Yes I forgot this wasn't Xbase++, there it would be: cFontName := "10.Arial
Bold"

> BTW, you can also use TCanvas:TextExtent()
Ok.
I have experimented and it's not enough to know the text width with a
certain font. I also need to know the system font DPI size set in the
Display properties -> Settings -> the General tab -> Display DPI Setting.
Please se the attached picture.
From Xbase++ I know that there is a function in USER32.DLL,
"GetSystemMetrics", parameter no. 30, which returns a value indicating the
DPI size. But I'm in the beginning of a learning process and for now I
would be very happy to avoid learning using DLL's and that kind of stuff.
Are there any ready made function available in (ok, or through) Xailer?
Regards,
Paal
Attached files
-
- Mensajes: 216
- Registrado: Dom Sep 23, 2007 11:08 pm
Function for text size in pixels?
>> (something like GetTextSizeFromFont( cFontName, cTextToMeasure )?
> Is the correct function. Your function prototype is not valid since it
> does
> not take care of font size or bold state.
Yes I forgot this wasn't Xbase++, there it would be: cFontName := "10.Arial
Bold"
> BTW, you can also use TCanvas:TextExtent()
Ok.
I have experimented and it's not enough to know the text width with a
certain font. I also need to know the system font DPI size set in the
Display properties -> Settings -> the General tab -> Display DPI Setting.
Please se the attached picture.
From Xbase++ I know that there is a function in USER32.DLL,
"GetSystemMetrics", parameter no. 30, which returns a value indicating the
DPI size. But I'm in the beginning of a learning process and for now I
would be very happy to avoid learning using DLL's and that kind of stuff.
Are there any ready made function available in (ok, or through) Xailer?
Regards,
Paal
Attached files
> Is the correct function. Your function prototype is not valid since it
> does
> not take care of font size or bold state.
Yes I forgot this wasn't Xbase++, there it would be: cFontName := "10.Arial
Bold"

> BTW, you can also use TCanvas:TextExtent()
Ok.
I have experimented and it's not enough to know the text width with a
certain font. I also need to know the system font DPI size set in the
Display properties -> Settings -> the General tab -> Display DPI Setting.
Please se the attached picture.
From Xbase++ I know that there is a function in USER32.DLL,
"GetSystemMetrics", parameter no. 30, which returns a value indicating the
DPI size. But I'm in the beginning of a learning process and for now I
would be very happy to avoid learning using DLL's and that kind of stuff.
Are there any ready made function available in (ok, or through) Xailer?
Regards,
Paal
Attached files
Function for text size in pixels?
Paal,
> I have experimented and it's not enough to know the text width with a
> certain font. I also need to know the system font DPI size set in the
> Display properties -> Settings -> the General tab -> Display DPI Setting.
> Please se the attached picture.
>
> From Xbase++ I know that there is a function in USER32.DLL,
> "GetSystemMetrics", parameter no. 30, which returns a value indicating the
> DPI size. But I'm in the beginning of a learning process and for now I
> would be very happy to avoid learning using DLL's and that kind of stuff.
> Are there any ready made function available in (ok, or through) Xailer?
Screen:nPixelsPerInch
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
> I have experimented and it's not enough to know the text width with a
> certain font. I also need to know the system font DPI size set in the
> Display properties -> Settings -> the General tab -> Display DPI Setting.
> Please se the attached picture.
>
> From Xbase++ I know that there is a function in USER32.DLL,
> "GetSystemMetrics", parameter no. 30, which returns a value indicating the
> DPI size. But I'm in the beginning of a learning process and for now I
> would be very happy to avoid learning using DLL's and that kind of stuff.
> Are there any ready made function available in (ok, or through) Xailer?
Screen:nPixelsPerInch
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
Function for text size in pixels?
Paal,
> I have experimented and it's not enough to know the text width with a
> certain font. I also need to know the system font DPI size set in the
> Display properties -> Settings -> the General tab -> Display DPI Setting.
> Please se the attached picture.
>
> From Xbase++ I know that there is a function in USER32.DLL,
> "GetSystemMetrics", parameter no. 30, which returns a value indicating the
> DPI size. But I'm in the beginning of a learning process and for now I
> would be very happy to avoid learning using DLL's and that kind of stuff.
> Are there any ready made function available in (ok, or through) Xailer?
Screen:nPixelsPerInch
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
> I have experimented and it's not enough to know the text width with a
> certain font. I also need to know the system font DPI size set in the
> Display properties -> Settings -> the General tab -> Display DPI Setting.
> Please se the attached picture.
>
> From Xbase++ I know that there is a function in USER32.DLL,
> "GetSystemMetrics", parameter no. 30, which returns a value indicating the
> DPI size. But I'm in the beginning of a learning process and for now I
> would be very happy to avoid learning using DLL's and that kind of stuff.
> Are there any ready made function available in (ok, or through) Xailer?
Screen:nPixelsPerInch
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
-
- Mensajes: 216
- Registrado: Dom Sep 23, 2007 11:08 pm
Function for text size in pixels?
> Screen:nPixelsPerInch
Thank you very much, that was it! I tried it earlier today and don't
understand why I didn't get it! Arghh...
Thanks,
Paal
Thank you very much, that was it! I tried it earlier today and don't
understand why I didn't get it! Arghh...
Thanks,
Paal
-
- Mensajes: 216
- Registrado: Dom Sep 23, 2007 11:08 pm
Function for text size in pixels?
> Screen:nPixelsPerInch
Thank you very much, that was it! I tried it earlier today and don't
understand why I didn't get it! Arghh...
Thanks,
Paal
Thank you very much, that was it! I tried it earlier today and don't
understand why I didn't get it! Arghh...
Thanks,
Paal