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

Fix the font alias name to lower case handling (#1385) #1485

Merged

Conversation

speckyspooky
Copy link
Contributor

Fix the font alias name to lower case handling (#1385)

@speckyspooky speckyspooky added this to the 4.14 milestone Nov 4, 2023
@speckyspooky speckyspooky added the BugFix Change to correct issues label Nov 4, 2023
@speckyspooky speckyspooky self-assigned this Nov 4, 2023
Copy link
Contributor

@claesrosell claesrosell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have some small comments. I read up on the issue itself and it seems like you guys are on top of the problem and the solution to it.

I think that it is hard to give code comments in a project like Birt. It is a lot of old code in Birt, and it is always a struggle to decide what one should change. Typically one wants to keep the changes small, but still wants to improve/modernize the code. If think that you have found a good balance here. Still, here are my suggestions for what I think would be an improvement.

public void merge(FontMappingConfig config) {
fontPaths.addAll(config.fontPaths);
fontAliases.putAll(config.fontAliases);

// fontAliases.putAll(config.fontAliases);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this, we have the old behavior in the GIT history.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nor problem, I will remove it.

Iterator iter = config.compositeFonts.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
Iterator<?> iterComposite = config.compositeFonts.entrySet().iterator();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it to.

@speckyspooky
Copy link
Contributor Author

@claesrosell
Thanks for your comments, I have done the changes. Of course sometimes it is really hard to change the old stuff. I like your suggestion of the looping to avoid the iterators.
At the end the change include only to change the alias names to lower case according to the font-alias-handling on the text areas (according to the original issue).

@claesrosell
Copy link
Contributor

Excellent! Go ahead and commit.

@speckyspooky speckyspooky merged commit eacaa00 into eclipse-birt:master Nov 5, 2023
3 checks passed
@hvbtup
Copy link
Contributor

hvbtup commented Nov 6, 2023

Thanks, Thomas!

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

Successfully merging this pull request may close these issues.

3 participants