calref / cboe

Classic Blades of Exile
http://spiderwebforums.ipbhost.com/index.php?/forum/12-blades-of-exile/
Other
168 stars 41 forks source link

Set font size explicitly for 'give item' and 'drop item' functions. (use dialogxml system?) #246

Open clort81 opened 4 years ago

clort81 commented 4 years ago

boe.items.cpp uses cDialog class, not using dialogxml system - apparently?

This leads to SFML expecting a 10-pt font whenever an item is given to another party member or dropped. I only have an 11pt font here. I've already changed all explicitly set 10 pt font heights to 11, for e.g. in help-party.xml:

<text font='plain' top='260' left='146' width='100' height='11'>

If the give and drop item functions also used dialogxml system, the fontstyle and height could be specified in an .xml file.

Alternatively drop_item(short pc_num,short item_num,location where_drop) and get_num_of_items(short max_num) in boe.items.cpp could be amended to specify font height and name, maybe?

I don't know how to set pointSize or TXT_SIZE before the cDialog numPanel("get-num"); so I'm stuck at the moment.

Thanks! cheers

clort81 commented 4 years ago

For now im workarounding with a line added to render_text.cpp under TextStyle::applyTo() line 35:

if(pointSize==10) pointSize=11;
CelticMinstrel commented 4 years ago

The schema for DialogXML can be found here. You'll notice that font size is specified as "small", "large", or "title", so the actual size can be set where those symbolic forms are translated to a number, ie in cTextMsg::parse. You'll see that small is 10-point, large is 12-point, and title is 18-point.

For the record, I'm happy that you took the time to make a font for us, but I do have to agree that it's strange you would make it at 11-point when the actual game uses either 10-point or 12-point. I guess it's twice as much work to make a 10/12-point font, or three times for a 9/10/12-point font, but it sure would be a lot easier to integrate such a font…

(There's even one place that uses 6-point and 8-point, but those probably aren't worth worrying about really. And anything over 12-point probably should just use a scalable font anyway, right?)

clort81 commented 4 years ago

My font is the same pixel size as original blades of exile. As proof i submit a composite of screenshot of original versus mine:

clortsanssize

I can make ClortSans nominally 12 pixels high by adding a pixel of padding. It cannot be made 10 pixels high without being smaller than the original Blades of Exile font.

Would that be acceptable?

CelticMinstrel commented 4 years ago

Well, the original Blades of Exile font in that screenshot (both Mac and Windows) is a 10-point font. I don't think point size and pixel size necessarily need to match up?

clort81 commented 4 years ago

Yes, point size is not the same as pixel size.

Here is my thesis, CelticMinstrel: To make Open BoE look like the original Blades of Exile game, the fonts need to look the same.

ClortSansBold-11.bdf is nearly identical to SSERIFE.FON, which is the font used in the original Blades of Exile and other Spiderweb Software games like Exile 1-3. It renders to 11 pixels high. including descenders.

The exception to this is that in original BoE, the text for "Party stats:" and "HP" and "SP" and "Gold" are 10 pixels high.

That UI innovation by JV - to make menu titles with identical function have different font sizes is .. unique in video game history, to my knowledge.

clortBoEsize2

I just created two "Twelve-point" bitmap fonts for you that also display the same as the fonts used in Original BoE.

I did this work just so you would not need to modify as many constants in the source code. The rendered glyphs for ClortSans-12 are identical to ClortSans-11.

They are included in the tar.gz below, along with a test SFML program.

bdftest.tar.gz

If there is a good reason why Open BoE ought to also use a 10-pixel font for the Party Stats, Hp, Sp, Food, Gold and Day, I can make a bitmap font for those as well.

The current antialiased vector fonts in Open BoE are BLURRY, hard to read and a stylistic collision with the rest of the game as well as 1980s-1990s computer video games as a whole. clortBoEsize3 These are objective facts. They are not statements of opinion or personal preference.

CelticMinstrel commented 4 years ago

I did some investigation myself, and it looks like the wonky font sizes must actually be a regression in the Windows version. On the Mac, the 10-point Geneva in the inventory title is exactly 10 pixels high, and in the bottom bar of the PC stats it's 8 pixels since there are no descenders there. This means the rendered text matches the height of the baked text! (In OBoE, the baked text is now rendered.)

Places that use 12-point font include the text bar that shows the area name as well as the item names and subtitle in the shopping screen, and some text on the title screen when a party is loaded. Possibly the text transcript as well, but not sure - I can't tell what it was using in the original game, but it's using 12-point in OBoE, so I'm guessing I probably managed to work it out correctly in the past (hopefully).

There's nowhere using 9-point font in the main game (unless there's a dialog that uses it), but the PC editor uses it a fair bit (along with 8-point and 6-point in exactly one place each).