1 person found this helpful
The text engine was completely rewritten from scratch in D11+ and is OS-independent. This effectively means it should render fonts the same across both platforms... but you refer to text fields... there are text members and field members, so to clarify, which one are you referring to? The new text engine's formatting features (antialiasing, kerning, and hinting) only apply to text members and not field members. I would tend to agree with you that it might be a slight difference between the pc and mac fonts that shows up in field members which don't take into consideration any of the advanced formatting, but I don't have a mac to test this.
sorry, yes, i mean fields. Text members do indeed display how they ought.
ok well I got two comps up now, one mac and one pc, and investigated further and sure enough the lineheight of the field member, when queried from the originating pc is 15. This is for a field that is Arial, fontsize 11. (These are single line fields by the way.)
on the mac the same field (in the same .dir) is now Helvetica, fontsize 11 but the lineheight is 11, not 15.
oddly (and this is why it matters to me) the next sprite has a lineheight of 13 (on the pc is its 15 again). So the two sprites are in alignment on the pc, but aren't on the mac.
well that's the problem, let's not worry about why it might occur; I just have to fix it!
Does anyone know
excuse that last line... how it got through quality control i don't know.
1 person found this helpful
You may get better luck if you embed the font. Helvetica and Arial are almost identical. And if Arial is not available, then Helvetica will be substituted. When it changes fonts, it may be messing with the lineheight for some reason. I don't think that Arial comes installed on Macs by default, though I know Helvetica does. And likewise, Arial is installed on PCs, not Helvetica.
Also, you should consider using #text members instead of fields for any text that you want to look nice. They get antialiased and generally look much better than #field members. They will probably also look more similar between OSes, since I believe that #fields use the OS for some things (like antialiasing) and Macs will look different than PCs.
thanks for that suggestion. I know that back in Dir8 when i wrote this beast of a programme, that text members were too slow to be used, as these fields get updated more or less each frame. Is it still the case that fields are quicker to update, and provide less strain on the programme running?
anyway, i just wrote a handler that sets the lineheight of any field 2 more than the fontsize and that seems to level things up as they should be. Also it replaces the font with Helvetica if its a Mac and it all looks nice.
re the font embedding, i do have Arial embedded as Arial * but it looks rubbish when applied to a field member. I assume because there's antialiasing in the font which the field doesn't allow. It looks great on text members of course, so I use it for that.
Actually though, the mac's Helvetica fields look much better (almost text member-like) than the pc's Arial fields.
Is it still the case that fields are quicker to update, and provide less strain on the programme running?
Yes, but horsepower has also increased a lot since the days of D8. If #text members are easier to implement and look better then I'd say "use them - you won't notice a performance difference", but you should test that for yourself.