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

How to fix help window gibberish text on mac #208

Open
caoliangnus opened this issue Nov 10, 2017 · 8 comments
Open

How to fix help window gibberish text on mac #208

caoliangnus opened this issue Nov 10, 2017 · 8 comments

Comments

@caoliangnus
Copy link

For Mac users, please refer to this PR

Before:
screen shot 2017-11-11 at 12 54 37 am

After:
screen shot 2017-11-11 at 12 54 57 am

@damithc
Copy link
Contributor

damithc commented Nov 11, 2017

Nice 👍
Confirmed works on all three OS: Windows, Linux, OS-X?

@caoliangnus
Copy link
Author

I am not sure about Linux system. For Windows, it has no such problem. For OS-X, I can confirm that it works.

@damithc
Copy link
Contributor

damithc commented Nov 11, 2017

I am not sure about Linux system. For Windows, it has no such problem. For OS-X, I can confirm that it works.

I meant, does it work on Windows after the fix? Fixing it for one platform can break it on another.

@caoliangnus
Copy link
Author

Yes, it works.

image

@caoliangnus
Copy link
Author

I realised that Google Map unable to load the page. Please see below for the solution.

Solution:
Change:
private static final String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko";

to:
private static final String USER_AGENT = "Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1";

Before:
screen shot 2017-11-11 at 12 33 12 pm

After:
image

@ZY-Ang
Copy link

ZY-Ang commented Nov 11, 2017

Thanks for the reuse offer. Works on Ubuntu 16.04 LTS

image

@damithc
Copy link
Contributor

damithc commented Nov 11, 2017

Thanks for the reuse offer. Works on Ubuntu 16.04 LTS

Nice.

@caoliangnus I encourage you to submit this fix as a PR to se-edu/addressbook-level4 , after the exams of course.

@Zhiyuan-Amos FYI

@ZY-Ang
Copy link

ZY-Ang commented Nov 11, 2017

@damithc @Zhiyuan-Amos I'm assuming @caoliangnus used this source https://stackoverflow.com/questions/41952734/javafx-webview-font-issue-on-mac for the fix.

Note that it might be hacky and probably using the other method in the comments, i.e. engine.setUserAgent(engine.getUserAgent().replace("Macintosh‌​; ", "")); might be better

As he said, setting the user agent to trick the system into thinking it is windows may not be such a good idea. Apparently Oracle knows about it and is a fix in Java 9: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8088205

However for the simplicity's sake, @caoliangnus's implementation should suffice

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

No branches or pull requests

3 participants