JFormDesigner / markdown-writer-fx

Markdown Writer FX
BSD 2-Clause "Simplified" License
434 stars 80 forks source link

**中国** Chinese didn't work as ecpected #14

Open iwifigame opened 7 years ago

JFormDesigner commented 7 years ago

@iwifigame thanks for reporting.

Yes, bold and italic do not work for Chinese characters in editor and preview.

Have no idea how to fix this. Maybe a JavaFX problem? Any ideas?

vincent7f commented 5 years ago

I confirm it's a bug in MacOS, not in Windows 7.

If I use Chinese input method to type some character, only the typed letters are showed in the editor, the Chinese char I inputed is NOT entered the editor and never showed. You could see the captured image as below. You could find that only the letter 'p' is showed, not the Chinese,

Screen Shot 2019-05-10 at 11 13 50
vincent7f commented 5 years ago

As s quick fix, user could paste the Chinese to this editor from the system clipboard.

用户可以通过系统剪贴版将中粘贴进这个编辑器。

vincent7f commented 5 years ago

I believe it is the same bug as issue #22 . Please merge them.

yuchuangu85 commented 2 years ago

@vincent7f I fix this issue, you can load the code from: https://github.com/yuchuangu85/markdown-writer-fx

DevCharly commented 2 years ago

@yuchuangu85 how did you fix it? The only differences I can see in your two commits is running on Java 11 and using newer RichTextFX version...

yuchuangu85 commented 2 years ago

@DevCharly I've been using the JDK 11 development environment, and I've been getting errors since I downloaded it, so I've changed the dependencies and the program is working fine.

yuchuangu85 commented 2 years ago

I added a Main. java class to run in JDK 11

DevCharly commented 2 years ago

@yuchuangu85 and using Java 11 (instead of 8) fixes #14 and #22?

yuchuangu85 commented 2 years ago

@DevCharly Yes, it' ok now.

south55 commented 2 years ago

This is not markdown-writer-fx problem,it is javafx webview problem

I use jdk17.0.2, below simplest code does not work too. public void start(Stage primaryStage) { WebView webView = new WebView(); try { webView.getEngine().loadContent("<p><strong>中文</strong></p>"); VBox vBox = new VBox(webView); Scene scene = new Scene(vBox, 960, 600); primaryStage.setScene(scene); primaryStage.show(); } catch (Exception e) { e.printStackTrace(); } }

And it is easy to fix, just add a chinese font. open markdownpad-github.css,
change font-family: Helvetica, arial, freesans, clean, sans-serif; to font-family: Microsoft YaHei UI,Helvetica, arial, freesans, clean, sans-serif; then it work. image