LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-11-2013, 09:44 AM   #1
prw8864
LQ Newbie
 
Registered: Apr 2013
Distribution: Suse 12.3
Posts: 18

Rep: Reputation: Disabled
how to calc font hight


if I have the following:
1) image resolution in pixels
2) hight of region in pixels
3) font type ie. times new roman

is there away to calculate the maximum font size that would fit within the hight of the region given?
I am looking for a formula / translation table to do this.
 
Old 09-13-2013, 04:46 AM   #2
firstfire
Member
 
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 709

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Hi.

Disclaimer: I'm just guessing..

Image resolution, as the name suggests, is measured in pixels per inch, not just in pixels. So, if vertical resolution of your image is VR (px/inch) and H is the given height in pixels, then H / VR is height in inches. Now, if you measure font size in points (1 inch is about 72 points), then maximum font size, which will fit in the given height H (pixels) is H/VR*72 (points).

Last edited by firstfire; 09-13-2013 at 04:47 AM.
 
  


Reply

Tags
calculation, font



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hight Availability in centOS ( luci ) nightwish Linux - Software 1 11-25-2011 07:54 AM
Hight Availability ( luci ) nightwish Linux - Software 2 11-21-2011 03:54 AM
why is my cpu always hight YubahaQ Linux - Desktop 6 02-06-2011 06:26 PM
udevd hight cpu usage tronica Slackware 0 11-24-2006 11:14 AM
Back to Hight Tech: Mandrake raxxal Fedora 2 04-13-2005 03:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration