|
Memberlist | Forum Rules | Search | Today's Posts | Mark Forums Read |
Search Forums: | Click here to use Advanced Search |
|
Thread Tools | Display Modes |
|
10-11-2012, 09:14 AM | #1 | ||
Join Date: Jul 2009
Location: Weilmunster, Germany
Posts: 136
|
Font Pixelsize - Without counting?
Hey guys!
I'm currently working on a game, that involves ASCII Art. In the background I want to have my engine that does the math stuff: collisions, position changes etc. Of course, the images (texts) differ in size (not in font size: number of chars), but use the same font. Now I need to know how large a character is in pixels at a certain font size, so that I can define one constant to calculate with. I want to achieve that without counting the pixels manually on screen. Is there a formula or maybe information stored somewhere at the font data? Its Fixedsys. I haven't found anything on the net so far. Thanks in advance! |
||
|
|
10-11-2012, 10:28 AM | #2 | ||
Join Date: Jul 2009
Location: Hungary
Posts: 760
|
lulz it depends on so many things, like whether the fonts are monospaced or not, and even then, what fonts you're using (Is it called Fixedsys?), and where... This has been an issue for me as well in programming. I don't believe the size of the characters is store anywhere, but we could say 12 point characters would be 8 pixels wide, since that is a power of 2 (don't ask why would that matter, I'm making educated guesses...). But that can only be applied to monospaced fonts, where every letter and character has the same width. The one I'm using right now is Times New Roman, where for example the letters I and O aren't equally wide. Courier New is an example of monospaced fonts, where I and O have the same width. Not sure if I understood your problem, but I tried to summarize my experiences.
__________________
Reverend Preacherbot: Wretched sinner unit! The path to Robot Heaven lies here, in the Good Book 3.0. Bender: Hey. Do I preach at you when you're lying stoned in the gutter? No! |
||
|
|
10-11-2012, 11:56 AM | #3 | ||
Join Date: Nov 2011
Location: ,
Posts: 72
|
I guess "Involving ASCII art" means "monospaced", am I correct?
Just a strong guess, but proportional fonts seem difficult to use with ASCII art... If you are using an IDE using the DTP point system (wild guess), then I think the font size will also depend on the screen's dpi value since a DTP point is measured in inch or mm, but not in pixels. Can you maybe give some more details about the programming environment and font you are using? Hope you keep us informed about your game and your progress with it. ;-) |
||
|
|
10-11-2012, 12:50 PM | #4 | ||
Join Date: Jul 2009
Location: Weilmunster, Germany
Posts: 136
|
Thanks for your replies!
The font is called "Fixedsys", which is, indeed, 8x8 pixels in standard size (and also a quite common one in ASCII Art, because it is regular). I simply don't grasp the connection between font size and it's size in pixels. So font size 12 means 8x8 pixels; font size 24 equals 16x16? I don't think so... I'm using Blitz3D, because I was quite advanced with QuickBasic, which unfortunatly became obsolete, because it's for DOS. |
||
|
|
10-11-2012, 05:16 PM | #5 | ||
Join Date: Nov 2011
Location: ,
Posts: 72
|
Quote:
Quote:
That font size refers to "typographic points". From http://en.wikipedia.org/wiki/Point_%28typography%29 (chapter "Current DTP point system"): "The desktop publishing point (DTP point) is defined as 1/72 of the Anglo-Saxon compromise inch of 1959 (25.4 mm) which makes it 0.0138 inch or 0.3527 mm. Twelve points make up a pica, and six picas make an inch." Long live the imperial units. As a result, that gives the real size of the font on the display - independent of its pixel density. |
||
|
|
10-11-2012, 05:35 PM | #6 | ||
Join Date: Jul 2009
Location: Weilmunster, Germany
Posts: 136
|
Quote:
What lines do you mean? I don't quite get it! |
||
|
|
10-11-2012, 06:02 PM | #7 | ||
Join Date: Nov 2011
Location: ,
Posts: 72
|
With "So the distance between lines and chars (in pixels) is still missing..." I wanted to say:
Even if you know that the font is 8x8 pixels per letter - you still need to know the distance (in pixels) between two consecutive letters (horizontally) and the distance between two lines (vertically) in order to calculate the total height of some ASCII art comprising more than one column or row. If there would be no additional few pixels between two lines, the letters of them would "stick together". =>
|
||
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Final Fantasy: Endless Nova Font Issues | sjdswanlund | Troubleshooting | 2 | 01-04-2009 02:10 PM |
Rpg Maker 2000 Font Problem | Emily | Troubleshooting | 2 | 04-02-2007 03:25 PM |
Dosbox Font | MrBackAlleySka | Tech Corner | 0 | 29-03-2005 11:48 PM |
Font Sites | JJXB | Tech Corner | 2 | 01-01-2005 09:37 PM |
Download Counting | Omuletzu | Old Suggestions | 21 | 25-08-2004 09:48 PM |
Thread Tools | |
Display Modes | |
|
|
||
  |