Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: how to convert from px to font sixe


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: May 30, 2017 11:03 PM Last Post By: Peter Below
al nickels

Posts: 173
Registered: 7/16/09
how to convert from px to font sixe  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 30, 2017 2:12 PM
Does anybody know how to convert from a given font size given px as html I want to calculate the best font size to use in an rtf view.
Paul TOTH

Posts: 196
Registered: 1/2/17
Re: how to convert from px to font sixe  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 30, 2017 11:02 PM   in response to: al nickels in response to: al nickels
Le 30/05/2017 à 23:12, al nickels a écrit :
Does anybody know how to convert from a given font size given px as html I want to calculate the best font size to use in an rtf view.

try this

Font.Height := -px
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: how to convert from px to font sixe  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 30, 2017 11:03 PM   in response to: al nickels in response to: al nickels
al nickels wrote:

Does anybody know how to convert from a given font size given px as
html I want to calculate the best font size to use in an rtf view.

See https://www.w3.org/TR/REC-CSS2/syndata.html#length-units

To convert a font size in pixels (dots) to a font size in points (1/72
inch) you need to assume a specific device resolution (dots per logical
inch). For a web page the browser usually works with 90 dpi for this
calculation.

--
Peter Below
TeamB
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02