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

[Feature Request] Replace some characters while generating. #5

Open
toshiya14 opened this issue May 31, 2022 · 20 comments
Open

[Feature Request] Replace some characters while generating. #5

toshiya14 opened this issue May 31, 2022 · 20 comments

Comments

@toshiya14
Copy link

Some symbols or punctuations are not displays very well and in this case, I would like to change the symbol to another.
For example:

图片

Replace the following characters while genereting.

"《" -> "「"
"》" -> "」"

@Soreepeong
Copy link
Owner

Soreepeong commented May 31, 2022

That shouldn't be too difficult to implement.

Regardless, to fix that kind of problem, you will have to adjust horizontal offset. Note the (람) here.

Without it:
image

With it:
image

@toshiya14 toshiya14 changed the title [Feature Request] Replace some character [Feature Request] Replace some characters while generating. May 31, 2022
@toshiya14
Copy link
Author

I changed the horizontal offset to 2px, but nothing changes.

@toshiya14
Copy link
Author

图片

If I set to 8px, it changes a little.
But I think the right side would be overflow, if I continue to increase the offset. XD

@Soreepeong
Copy link
Owner

Soreepeong commented May 31, 2022

Try this one, and let me know if it works as you would think.

XivRes.FontGenerator64 (2).zip

For now, though, you'll have to edit the saved json files manually; save it, open the file with a text editor, and edit codepointReplacements.

{
    "codepointReplacements": {
        "《": "",
        "》": ""
    }
}

@toshiya14
Copy link
Author

Could you give me a new release? I did not have the environment for cpp ready.
So I think I could hardly compile it by myself.

@toshiya14
Copy link
Author

Try this one, and let me know if it works as you would think.

XivRes.FontGenerator64 (2).zip

For now, though, you'll have to edit the saved json files manually; save it, open the file with a text editor, and edit codepointReplacements.

{
    "codepointReplacements": {
        "《": "",
        "》": ""
    }
}

I am sorry, I did not realize you posted the release.

@toshiya14
Copy link
Author

The version you have just provided loaded the config as ascent always 11.
图片

@toshiya14
Copy link
Author

I found that when I load the json, the chnasix becomes empty.

@Soreepeong
Copy link
Owner

That is correct. That font features 14px line height and 11px ascent when font size is set to 12px.

For everything being displayed in the same line, each font face will be configured from the first entry in the list. In this case, it'll take line height and ascent as "0px" from the first entry.

@toshiya14
Copy link
Author

图片

@Soreepeong
Copy link
Owner

Can you share the latest file you're working with again?

@toshiya14
Copy link
Author

The gist has been updated.
https://gist.github.com/toshiya14/f4d255152b398194bbd6c006e0d25530

This version with release 0.0.0.1 is fine.
But just a little problem.
图片

@toshiya14
Copy link
Author

Try this one, and let me know if it works as you would think.

XivRes.FontGenerator64 (2).zip

For now, though, you'll have to edit the saved json files manually; save it, open the file with a text editor, and edit codepointReplacements.

{
    "codepointReplacements": {
        "《": "",
        "》": ""
    }
}

This version seems not load my preset correctly.
Then generated mod is works bad.

@Soreepeong
Copy link
Owner

Ah, it will do that if game path has not been configured correctly, and it seems that you've downloaded the updated version but didn't change config.json. Try copying that file over to the new exe file directory.

@toshiya14
Copy link
Author

Just an advice. You could add the version number to the windows title.
If I post screenshot, then you could identify them. XD

@toshiya14
Copy link
Author

toshiya14 commented May 31, 2022

This settings seems not work, I am using "UTF-8" to saving my preset.
Should I use a native language encoding such as "ANSI/GBK"?
图片
图片

=========================
Actually, if I do not use the UTF-8.
It would alert me. XD
图片

@Soreepeong
Copy link
Owner

Ah, I should have said better. It goes inside face element, like this:

image

Also yeah, only UTF-8 is the valid JSON charset!

@toshiya14
Copy link
Author

toshiya14 commented May 31, 2022

图片

I tried to add the replacement. It becomes more strange than before. XD

I have tried to input 《》 in chat, and others could see the them, but I could not.
图片
It should be 《》←左边有东西吗?

Also, I updated the gist again.

@Soreepeong
Copy link
Owner

XivRes.FontGenerator64 (2).zip

I've fixed that problem. Try it again! I can now confirm that at least in preview it looks good.
image

@toshiya14
Copy link
Author

图片
It works!

But the quotes still strange.
I have tested the preset you have posted in another issue.
That works fine.
#2 (comment)

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