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

获取网页目录乱码和无法生成C++Primer.Plus(第6版)中文版.pdf目录 #14

Open
chenzhujin opened this issue Nov 2, 2020 · 4 comments

Comments

@chenzhujin
Copy link

点击生成目录没有任何反应,请作者指导

@gongchunru
Copy link

使用 release 确实有这个问题。
可以试试直接在IntelliJ IDEA跑代码,我这边试了没问题可以用。

@fishiu
Copy link

fishiu commented Mar 16, 2021

同在线获取目录乱码,测试页面为
http://product.china-pub.com/195631
自己编译的版本

  • macOS 11.2.3
  • java 15.0.2
  • Gradle 6.8.3

@youncyb
Copy link

youncyb commented Jul 11, 2021

macOS 下乱码的原因是JavaFX获取系统默认字体时出现了问题,具体原因还不得而知,解决方法如下:

  1. 先在pdf-bookmark目录下添加resources文件夹
  2. resources目录下新建application.css
.root{
    -fx-font-size: 16pt;
    -fx-font-family: "Courier New";
    -fx-base: rgb(132, 145, 47);
    -fx-background: rgb(225, 228, 203);
}
  1. 修改pdf-bookmark/src/main/java/com/ifnoelse/pdf/gui/Main.java
        Scene scene = new Scene(vBox, 600, 400);
        scene.getStylesheets().add("application.css"); //添加内容
        primaryStage.setScene(scene);
  1. 修改build.gradle,最后面添加:
processResources {
    from('resources') {
        include 'application.css'
    }
}
  1. 重新运行:./gradlew jlink

@TtlyLynzie
Copy link

TtlyLynzie commented Jun 15, 2022

macOS 下乱码的原因是JavaFX获取系统默认字体时出现了问题,具体原因还不得而知,解决方法如下:

  1. 先在pdf-bookmark目录下添加resources文件夹
  2. resources目录下新建application.css
.root{
    -fx-font-size: 16pt;
    -fx-font-family: "Courier New";
    -fx-base: rgb(132, 145, 47);
    -fx-background: rgb(225, 228, 203);
}
  1. 修改pdf-bookmark/src/main/java/com/ifnoelse/pdf/gui/Main.java
        Scene scene = new Scene(vBox, 600, 400);
        scene.getStylesheets().add("application.css"); //添加内容
        primaryStage.setScene(scene);
  1. 修改build.gradle,最后面添加:
processResources {
    from('resources') {
        include 'application.css'
    }
}
  1. 重新运行:./gradlew jlink

第五步运行错误

  • What went wrong:
    A problem was found with the configuration of task ':jlink' (type 'JlinkTask').
    • In plugin 'org.beryx.jlink' type 'org.beryx.jlink.JlinkTask' property 'imageDirAsFile' is annotated with @PathSensitive but that is not allowed for 'OutputDirectory' properties.

      Reason: This modifier is used in conjunction with a property of type 'OutputDirectory' but this doesn't have semantics.

      Possible solution: Remove the '@PathSensitive' annotation.

      Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#incompatible_annotations for more details about this problem.

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

5 participants