Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawing CJK strings loaded from external files? #86

Closed
moppin opened this issue Jul 4, 2020 · 4 comments
Closed

Drawing CJK strings loaded from external files? #86

moppin opened this issue Jul 4, 2020 · 4 comments

Comments

@moppin
Copy link

moppin commented Jul 4, 2020

Hi! Firstly I apologize if this isn't the right place to be asking questions in, I don't know much about how github works..

I'd really love to use Scribble for my game, but upon testing around with it I noticed that it can't draw letters that haven't been generated as texture from the font settings.
The thing is, my game is in Japanese (and I also plan to localize it into Chinese and Korean), and have my game set up so that most strings will be read from an external .csv file.
With CJK where the amount of letters that could be used may go up to about a few hundred unique ones, it's a bit unrealistic to generate font textures for it from the IDE by setting range as it would get massive and take forever to load, so I've been using fonts loaded with font_add() as fonts loaded this way could render letters on-demand.

I'm wondering if there's any way to get Scribble to work in a situation like this?

@moppin
Copy link
Author

moppin commented Jul 5, 2020

Ah sorry never mind, I posted this on the assumption that font range can't easily be defined when working with a .csv file, but just now found that you can indeed add range from a .csv file. My bad!

@moppin moppin closed this as completed Jul 5, 2020
@JujuAdams
Copy link
Owner

JujuAdams commented Jul 5, 2020

I've been thinking about trying to get Scribble to work with font_add() so I'll take a look at that when I get a chance. I'm glad you found a solution for your problem though!

If GitHub issues aren't convenient, you're welcome to send me an email or Twitter DM etc.

Edit: Ticket for font_add() here

@moppin
Copy link
Author

moppin commented Jul 6, 2020

Ah thank you for your response!
I still have my fears that the font texture might get too big after actually putting in loc for Chinese and Korean, but for now just defining the font range from file seems to do just fine so I'll work with that until I do come across real problems.

Unrelated note but your GMS Data Structure presentation video was what got me to really understand and start using the ds functions (and now can't live without) so thank you for that :) Scribble is going to be really helpful for my current project too, I super appreciate all the helpful things you are putting out! Thank you so much!

@JujuAdams
Copy link
Owner

We ran into this exact problem when porting The Swords of Ditto to CJK. I think it's possible for me to make a little function that combines GM fonts together inside Scribble to work around GM's limitation of one texture per font. This means you could have individual fonts for each language group, or even a couple fonts per character set if textures get too large, then squish them all together into a single font reference.

That JSON talk gets watched a lot, it's a little embarrassing 😓 I'm really happy it helps people though. The new version of GM is gonna change how we use JSON and think about data, it's very exciting (I've got a library here that I'm slowly adding to)

Good luck with your game!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants