Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AbrahamR), 717 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
text aligment with correct spacing #332579
07/10/10 20:44
07/10/10 20:44
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Hello
I would like to be possible to type a digit with a var, that aligns the number from right to left... for ANY TrueType font.. Without messing up the aligment.

I want Arial to work! come on! How come? i have to use courier? LOL

this is the situation:


var value;

Panel with this:
Code:
PANEL* test = 
{	
pos_x=20;
pos_y=20;
size_x=200;
size_y=120;		
flags= SHOW;

digits(90,37,\"%5.0f Messages\",Arial#18b,1,value);
digits(90,56,\"%5.0f Messages\",Courier#18b,1,value);
layer=3;
}



Use console TAB to change in runtime value to 10, 100, 1000...
And they will act very very different.

Also Times font wont work!?
Thats not logical without a remark!

And im not using spaces, just numbers.

the manual is clear and even gives example "
TrueType or bitmap character set for the display. Either a predefined FONT, or A6.6 a font filename or Truetype font name with size and style (like "Arial#24bi") can be given. If '*' ist given, the engine standard font is used."

flags] = Optional one or more of the following characters:
- = Left align the number within the given field width. Default: Right align.


I dont know what is the algorithm you use to align, but that "feature" is not what its saying for sure. it Should work for ANY Font.

Thanks! and i think this is really embarrassing for you...

Last edited by MMike; 07/10/10 20:46.
Re: text aligment with correct spacing [Re: MMike] #332601
07/11/10 02:04
07/11/10 02:04
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Arial is a proportional font. For aligning numbers you need a fixed width font because otherwise spaces and all letters and digits have a different width.

http://en.wikipedia.org/wiki/Typeface

You also should know that this format string is a C standard, its implemented this way in all C compilers.

http://msdn.microsoft.com/en-us/library/56e442dc%28VS.71%29.aspx

Re: text aligment with correct spacing [Re: Spirit] #332604
07/11/10 02:53
07/11/10 02:53
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Spirit is correct, with links to support what Ive said elsewhere.

Thanks bud...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: text aligment with correct spacing [Re: EvilSOB] #332610
07/11/10 03:53
07/11/10 03:53
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Ahum thanks for the links.. i see the problem
I though the advantadge of using TTfont its because they are proporcional! I though that was a RULE, and for the old retro look i could use a bitmap yeah, thats why i also use TTFonts..
Though the font on there doesnot match the Photoshop Fonts :S they never are the same, there is some smoothing issue there.

Thanks for the input, i will build the bitmap.
BUT ANYWAY, manual should be clear about this, because the exame is Arial etc...

Re: text aligment with correct spacing [Re: MMike] #332615
07/11/10 07:41
07/11/10 07:41
Joined: Sep 2003
Posts: 303
Germany
Clemens Offline
Senior Member
Clemens  Offline
Senior Member

Joined: Sep 2003
Posts: 303
Germany
(TT-)Fonts which are proportional (having a constant width) are calling monospaced font

List of monospaced fonts

Re: text aligment with correct spacing [Re: Clemens] #332671
07/11/10 14:33
07/11/10 14:33
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
but i can use those, right? the PC of the other user if dont have the font.. wont work!

Re: text aligment with correct spacing [Re: Clemens] #332680
07/11/10 15:17
07/11/10 15:17
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Originally Posted By: Clemens
(TT-)Fonts which are proportional (having a constant width) are calling monospaced font

List of monospaced fonts


well thanks for your input.
Is lucida console monospaced??

according to this Source it is...
But is not working here:
http://www.codestyle.org/css/font-family/sampler-Monospace.shtml


And how do i type that?
font.. = "lucidaconsole#20" ?

Last edited by MMike; 07/11/10 15:19.
Re: text aligment with correct spacing [Re: MMike] #332690
07/11/10 16:27
07/11/10 16:27
Joined: Sep 2003
Posts: 303
Germany
Clemens Offline
Senior Member
Clemens  Offline
Senior Member

Joined: Sep 2003
Posts: 303
Germany
Quote:
calling
called! ^^

Back to topic: Not shure if I've understood you. Have a try... wink

If your source says it's monospace, I guess so.. even it shows that it is, doesn't it?
just try!

Yeah, you define them like any other truetype font. But I must confess that finding out whats the expected name did confuse me in the past sometimes, too.
I believe it was just the name the font have got from its author.

If you want to make sure, that every user of your program/game have the font - just put it inside your package
(there are as well some scripts installing a font automatic)

Re: text aligment with correct spacing [Re: Clemens] #332700
07/11/10 17:35
07/11/10 17:35
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
my, the source ( the link) i had above..says lucida console is monospace but thats false...

I tried using BMAP fonts ,but its ugly those spaces are huge :s
so sad, this is only for fixed width fonts...


Last edited by MMike; 07/11/10 17:44.
Re: text aligment with correct spacing [Re: MMike] #332721
07/11/10 18:47
07/11/10 18:47
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Ok the solution for my problem is this:
Create a text entity, and then use the REVERSE Flag like hebruew and that did it.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1