1
0
mirror of synced 2025-02-08 22:59:41 +01:00

Basic Support for japanese chars

This commit is contained in:
Stepland 2020-02-27 00:12:31 +01:00
parent c00db7d6f7
commit d49f8188b9
3 changed files with 11 additions and 5 deletions

View File

@ -30,6 +30,7 @@
- Black frame
- Sound
- Music Sample
- Async playback
### Misc
- Handling Resolution changes
@ -39,11 +40,16 @@
- Add KeyMapping to preferences
- Make KeyMapping look nicer in json form
- Sort by button
- Handle JCK and special characters
- Japanese
- utf8 to sfml conversion
## TODO
### Misc
- Make Drawables lazily react to resolution changes
- Handle JCK and special characters
- Find a font that handles more stuff
- make a ttc bundle : https://fontforge.org/en-US/
### Music Select Screen
- Sound

View File

@ -154,7 +154,7 @@ namespace MusicSelect {
}
sf::Text song_title;
song_title.setFont(m_resources.fallback_font.medium);
song_title.setString(m_song->title);
song_title.setString(sf::String::fromUtf8(m_song->title.begin(), m_song->title.end()));
song_title.setCharacterSize(static_cast<unsigned int>(0.06875f*get_size()));
song_title.setFillColor(sf::Color::White);
auto song_title_bounds = song_title.getLocalBounds();
@ -184,7 +184,7 @@ namespace MusicSelect {
sf::Text message;
message.setFont(m_resources.fallback_font.medium);
message.setString(m_message);
message.setString(sf::String::fromUtf8(m_message.begin(), m_message.end()));
message.setCharacterSize(static_cast<unsigned int>(0.1f*get_size()));
message.setFillColor(m_color);
auto bounds = message.getLocalBounds();

View File

@ -80,7 +80,7 @@ namespace MusicSelect {
auto song_title = selected_chart->song.title;
if (not song_title.empty()) {
sf::Text song_title_label{
song_title,
sf::String::fromUtf8(song_title.begin(), song_title.end()),
m_resources.fallback_font.medium,
static_cast<unsigned int>(
0.026315789f*get_screen_width()
@ -101,7 +101,7 @@ namespace MusicSelect {
auto song_artist = selected_chart->song.artist;
if (not song_artist.empty()) {
sf::Text song_artist_label{
song_artist,
sf::String::fromUtf8(song_artist.begin(), song_artist.end()),
m_resources.fallback_font.medium,
static_cast<unsigned int>(
0.02f*get_screen_width()
@ -162,7 +162,7 @@ namespace MusicSelect {
}
sf::Text chart_label{
full_difficulty,
sf::String::fromUtf8(full_difficulty.begin(), full_difficulty.end()),
m_resources.fallback_font.medium,
static_cast<unsigned int>(20.f/768.f*get_screen_width())
};