mkxp/binding-mri
Jonas Kulla 1ef6e04520 Font: Overhaul font asset discovery
Previously, any font names requested by RGSS would be translated
directly to filenames by lowercasing and replacing spaces with
underscores (and finally doing some extension substitution).
To make this whole thing work smoother as well as get closer to
how font discovery is done in VX, we now scan the "Fonts/" folder
at startup and index all present font assets by their family name;
now, if an "Open Sans" font is present in "Fonts/", it will be
used regardless of filename.

Font assets with "Regular" style are preferred, but in their
absence, mkxp will make use of any other style it can find for
the respective family. This is not the exact same behavior as
VX, but it should cover 95% of use cases.

Previously, one could substitute fonts via filenames, ie. to
substitute "Arial" with "Open Sans", one would just rename
"OpenSans.ttf" to "arial.ttf" and put it in "Fonts/". With the
above change, this is no longer possible. As an alternative, one
can now explicitly specify font family substitutions via mkxp.conf;
eg. for the above case, one would add

fontSub=Arial>Open Sans

to the configuration file. Multiple such rules can be specified.

In the process, I also added the ability to provide
'Font.(default_)name' with an array of font families to search
for the first existing one instead of a plain string.
This makes the behavior closer to RMXP; however, it doesn't
work 100% the same: when a reference to the 'Font.name' array is
held and additional strings are added to it without re-assignig
the array to 'Font.name', those will be ignored.
2014-04-16 13:37:22 +02:00
..
audio-binding.cpp MRI-Binding: Optimize RB_ARG_END vaarg guard 2013-12-20 11:29:12 +01:00
binding-mri.cpp MRI-Binding: Define 'msgbox' p/print aliases (RGSS3) 2014-04-11 13:31:09 +02:00
binding-types.h Initial commit 2013-09-01 16:27:21 +02:00
binding-util.cpp Input: Implement RGSS3 functionality in bindings 2014-02-03 15:04:57 +01:00
binding-util.h Input: Implement RGSS3 functionality in bindings 2014-02-03 15:04:57 +01:00
bitmap-binding.cpp Font: Overhaul font asset discovery 2014-04-16 13:37:22 +02:00
disposable-binding.h Initial commit 2013-09-01 16:27:21 +02:00
etc-binding.cpp Transition from QtCore to stdc++ / STL / boost 2013-12-29 13:59:26 +01:00
filesystem-binding.cpp Transition from QtCore to stdc++ / STL / boost 2013-12-29 13:59:26 +01:00
flashable-binding.h MRI-Binding: Optimize RB_ARG_END vaarg guard 2013-12-20 11:29:12 +01:00
font-binding.cpp Font: Overhaul font asset discovery 2014-04-16 13:37:22 +02:00
graphics-binding.cpp MRI-Binding: Add 'Graphics.width/height' bindings (RGSS2) 2014-04-11 13:34:19 +02:00
input-binding.cpp Input: Implement RGSS3 functionality in bindings 2014-02-03 15:04:57 +01:00
module_rpg.cpp Initial commit 2013-09-01 16:27:21 +02:00
module_rpg.rb.xxd Initial commit 2013-09-01 16:27:21 +02:00
plane-binding.cpp MRI-Binding: Reduce number of object allocations 2013-10-30 10:06:24 +01:00
sceneelement-binding.h MRI-Binding: Optimize RB_ARG_END vaarg guard 2013-12-20 11:29:12 +01:00
serializable-binding.h Initial commit 2013-09-01 16:27:21 +02:00
sprite-binding.cpp Sprite: Implement wave effect (RGSS2) 2014-02-03 15:32:50 +01:00
table-binding.cpp Merge #8 2014-01-02 00:11:57 +01:00
tilemap-binding.cpp MRI-Binding: Optimize RB_ARG_END vaarg guard 2013-12-20 11:29:12 +01:00
viewport-binding.cpp MRI-Binding: Optimize RB_ARG_END vaarg guard 2013-12-20 11:29:12 +01:00
viewportelement-binding.h MRI-Binding: Optimize RB_ARG_END vaarg guard 2013-12-20 11:29:12 +01:00
window-binding.cpp MRI-Binding: Reduce number of object allocations 2013-10-30 10:06:24 +01:00