Skip to content

Specify the Culture while searching the font#1129

Merged
tonyqus merged 2 commits into
nissl-lab:masterfrom
Bykiev:FixSixLaborsFont
Aug 17, 2023
Merged

Specify the Culture while searching the font#1129
tonyqus merged 2 commits into
nissl-lab:masterfrom
Bykiev:FixSixLaborsFont

Conversation

@Bykiev
Copy link
Copy Markdown
Collaborator

@Bykiev Bykiev commented Jul 25, 2023

Specify the Culture while searching the font

Specify the Culture while searchig the font
@lahma
Copy link
Copy Markdown
Collaborator

lahma commented Jul 25, 2023

What's the benefit? Isn't current culture the default and thus causes difference between in CI runs and end use experience?

@Bykiev
Copy link
Copy Markdown
Collaborator Author

Bykiev commented Jul 25, 2023

@lahma, hello, nice to see you here!
The default culture is InvariantCulture, that's why if the system/thread culture is not English you'll be unable to find culture-specific fonts. See here for more information

@Bykiev
Copy link
Copy Markdown
Collaborator Author

Bykiev commented Jul 25, 2023

Btw, there are a lot of tests in NPOI are failing in non-English environment because of not specified culture (e.g. comparing text 0.9 while in some cultures where comma is decimal separator it's 0,9)

@lahma
Copy link
Copy Markdown
Collaborator

lahma commented Jul 25, 2023

Thanks for the clarification. I was just wondering about how the culture changes the matching, is it just string-matching the name and family? Getting the CI run properly on Linux seems to be a battle but it doesn't seem to be a problem on Windows so probably just Font presence issue - not about the name.

This might be a problem in a long run when people test them in "current culture" and then run on cloud environment like Azure where it's en-US IIRC.

@Bykiev
Copy link
Copy Markdown
Collaborator Author

Bykiev commented Jul 25, 2023

Thanks for the clarification. I was just wondering about how the culture changes the matching, is it just string-matching the name and family?

Yes, you're right,you can find code here. I believe it's ok, many places in NPOI where CurrentCulture is used

@lahma
Copy link
Copy Markdown
Collaborator

lahma commented Jul 25, 2023

Thanks for the clarification. I was just wondering about how the culture changes the matching, is it just string-matching the name and family?

Yes, you're right,you can find code here. I believe it's ok, many places in NPOI where CurrentCulture is used

Sorry for repeating myself here.. 🙂 As I can see it should be case-insensitive so there are some cases where it fails, I'm trying to understand what's the input and wrong output.

@tonyqus
Copy link
Copy Markdown
Member

tonyqus commented Aug 17, 2023

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants