### Godot version

v4.0.beta10.official [d0398f62f]

### System information

Windows 10, Vulkan

### Issue description

When I was testing my `debug_draw_3d` extension, I noticed that the graph titles change their size strangely.
For example, here, with a font size of 41 for one of the titles, instead of `fps5` it draws `fps6` with a font size of 14.
But the ascent of the font is taken correctly, which is why the title goes down a lot.
![godot windows editor dev x86_64_u0CvcAfqjh](https://user-images.githubusercontent.com/7782218/209420557-17f32fcc-c64c-44ff-9f08-4a11119d4ac8.gif)

I found that these hashing functions create the same hash for `fps5: 41`, `fps6: 14` and `fps8: 76`.
https://github.com/godotengine/godot/blob/f7cf9fb148140b86ee5795110373a0d55ff32860/scene/resources/font.cpp#L273-L291
https://github.com/godotengine/godot/blob/f7cf9fb148140b86ee5795110373a0d55ff32860/scene/resources/font.cpp#L303-L323
(also both of these parts of the code are repeated 3 times)

Here's what I get in MRP:
![image](https://user-images.githubusercontent.com/7782218/209420974-0cbcbb95-81a9-42e9-a9af-4b71b8715769.png)

Expected something like this:
![image](https://user-images.githubusercontent.com/7782218/209421473-4a019989-f432-40c0-b9af-c40ec969ade8.png)

Affected `Font` methods: `get_string_size`, `get_multiline_string_size`, `draw_string`, `draw_multiline_string`, `draw_string_outline`, `draw_multiline_string_outline`.

### Steps to reproduce

* Open MRP
* Notice the gray rectangles and the text somewhere near them (the text should be on top of the rectangles)
* Move the slider for the `second_font_size` parameter and watch glitches on some values.

Also, if you cache a lot of variants for `second_font_size`, and then change `first_font_size`(or vice versa), then there will be a more glitches:
![Godot_v4 0-beta10_win64_r0jJoStkQd](https://user-images.githubusercontent.com/7782218/209422373-c4ca1238-b351-4cbc-b451-136bbdb4fee0.gif)


### Minimal reproduction project

[Font Bad Hash.zip](https://github.com/godotengine/godot/files/10298021/Font.Bad.Hash.zip)

Ref<Image> img_g = memnew(Image(w, h, 0, Image::FORMAT_LA8, imgdata_g));
	set_texture_image(0, Vector2i(p_sz, 0), p_page, img_g);
	Ref<Image> img_o = memnew(Image(w, h, 0, Image::FORMAT_LA8, imgdata_o));
	set_texture_image(0, Vector2i(p_sz, p_ol), p_page, img_o);
}
void FontFile::_bind_methods() {
	ClassDB::bind_method(D_METHOD("load_bitmap_font", "path"), &FontFile::load_bitmap_font);
	ClassDB::bind_method(D_METHOD("load_dynamic_font", "path"), &FontFile::load_dynamic_font);
	ClassDB::bind_method(D_METHOD("set_data", "data"), &FontFile::set_data);
	ClassDB::bind_method(D_METHOD("get_data"), &FontFile::get_data);
	ClassDB::bind_method(D_METHOD("set_font_name", "name"), &FontFile::set_font_name);
	ClassDB::bind_method(D_METHOD("set_font_style_name", "name"), &FontFile::set_font_style_name);
	ClassDB::bind_method(D_METHOD("set_font_style", "style"), &FontFile::set_font_style);
	ClassDB::bind_method(D_METHOD("set_font_weight", "weight"), &FontFile::set_font_weight);
	ClassDB::bind_method(D_METHOD("set_font_stretch", "stretch"), &FontFile::set_font_stretch);
	ClassDB::bind_method(D_METHOD("set_antialiasing", "antialiasing"), &FontFile::set_antialiasing);
	ClassDB::bind_method(D_METHOD("get_antialiasing"), &FontFile::get_antialiasing);
	ClassDB::bind_method(D_METHOD("set_generate_mipmaps", "generate_mipmaps"), &FontFile::set_generate_mipmaps);
	ClassDB::bind_method(D_METHOD("get_generate_mipmaps"), &FontFile::get_generate_mipmaps);
	ClassDB::bind_method(D_METHOD("set_multichannel_signed_distance_field", "msdf"), &FontFile::set_multichannel_signed_distance_field);
	ClassDB::bind_method(D_METHOD("is_multichannel_signed_distance_field"), &FontFile::is_multichannel_signed_distance_field);
	ClassDB::bind_method(D_METHOD("set_msdf_pixel_range", "msdf_pixel_range"), &FontFile::set_msdf_pixel_range);
	ClassDB::bind_method(D_METHOD("get_msdf_pixel_range"), &FontFile::get_msdf_pixel_range);
	ClassDB::bind_method(D_METHOD("set_msdf_size", "msdf_size"), &FontFile::set_msdf_size);
	ClassDB::bind_method(D_METHOD("get_msdf_size"), &FontFile::get_msdf_size);
	ClassDB::bind_method(D_METHOD("set_fixed_size", "fixed_size"), &FontFile::set_fixed_size);
	ClassDB::bind_method(D_METHOD("get_fixed_size"), &FontFile::get_fixed_size);
	ClassDB::bind_method(D_METHOD("set_allow_system_fallback", "allow_system_fallback"), &FontFile::set_allow_system_fallback);
	ClassDB::bind_method(D_METHOD("is_allow_system_fallback"), &FontFile::is_allow_system_fallback);
	ClassDB::bind_method(D_METHOD("set_force_autohinter", "force_autohinter"), &FontFile::set_force_autohinter);