Fix#24456
The character->rect.size is properly update at DynamicFontAtSize::_bitmap_to_character
so no need to multiply scale again.
It was changed with 5cd12f6649
- Editor font anti-aliasing can now be disabled in the Editor Settings.
- DynamicFonts used in projects can now have their anti-aliasing
disabled in their DynamicFontData child. Changes will be visible
upon reloading the scene in the editor.
Means the list is destroyed before the OS object, allowing it the
opportunity to print an error if there are still dynamic font objects
hanging around.
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
This commit makes operator[] on Vector const and adds a write proxy to it. From
now on writes to Vectors need to happen through the .write proxy. So for
instance:
Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;
Failing to use the .write proxy will cause a compilation error.
In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.
_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
Some classes use Font::get_char_size directly and not only for
autowrapping. RichTextLabel is one such example. So this commit
reverts aa8561d (PR #17504) and instead ceils character width within
Label. This makes sure Label autowraps correctly while not affecting
other Font clients.
Fixes#18835.
Fixes#15787.
The issue occurred when two (or more) separate DynamicFont instances
used the same DynamicFontAtSize instance due to having equal
properties. The first instance updated its data_at_size and emitted
"changed" signal, but the second did not because it considered the
data_at_size to be up to date, even though it has just been updated.
- Implement outlines based on FreeType Stroker API. This allows
artifact-free results, similar to what you will see in Web or any text
editing tools. Outline is a part of DynamicFont rather than Label,
because outlines have to be baked into the font's atlas. Font has a
default outline_color and a Label can specify font_outline_modulator
that will be multiplied with the Font's color to get the final result.
- draw_char now has to be called twice to fully render a text - first
with p_outline == true for each character and then with
p_outline == false for each character.
- Number of draw-calls is reduced from 5 to 2 per outlined character.
- Overall cleanup of DynamicFont code, extracted duplicated code pieces
into separate methods.
- The change is backward-compatible - Labels still have outline
properties that work exactly as they worked before.
Closes#16279.
Fixes#15459. When oversampling is enabled, glyphs may have fractional
size, but they are still rendered into integral pixels, which results in
them taking more space than was anticiped by autowrapping algorithm. The
solution here is to return ceiled width, which makes autowrapper
consider characters a bit larger than they are, but it doesn't hurt the
actual rendering and ensures there is enough space for the characters.
- Editor font hinting can now be tweaked in the Editor Settings.
- DynamicFonts used in projects now have tweakable hinting settings
in their DynamicFontData child. Changes will be visible upon
reloading the scene in the editor.
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
It had been missed in d09160a8b6 and broke compilation
for those platforms.
Took the opportunity to run clang-format on the code base to fix some corner cases
that went through our static tests/were overlooked recently.
Rename user facing methods and variables as well as the corresponding
C++ methods according to the folloming changes:
* pos -> position
* rot -> rotation
* loc -> location
C++ variables are left as is.
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code