Increased default char width.

This commit is contained in:
Andrew Lalis 2020-11-08 00:25:59 +01:00
parent dc88ca8c4c
commit e1036940f9
4 changed files with 33 additions and 6 deletions

28
pom.xml
View File

@ -13,6 +13,34 @@
<maven.compiler.target>12</maven.compiler.target> <maven.compiler.target>12</maven.compiler.target>
</properties> </properties>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>nl.andrewlalis.blockbookbinder.BlockBookBinder</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies> <dependencies>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --> <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency> <dependency>

View File

@ -13,6 +13,10 @@ import java.awt.event.ActionListener;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
/**
* Action listener that is used for when a user decides to begin exporting a
* book to minecraft.
*/
public class BookExportActionListener implements ActionListener { public class BookExportActionListener implements ActionListener {
private final BookPreviewPanel bookPreviewPanel; private final BookPreviewPanel bookPreviewPanel;
private final Clipboard clipboard; private final Clipboard clipboard;

View File

@ -14,7 +14,7 @@ public class CharWidthMapper {
} }
public int getWidth(char c) { public int getWidth(char c) {
return this.charWidthMap.getOrDefault(c, 0); return this.charWidthMap.getOrDefault(c, 6);
} }
private void initCharWidthMap() { private void initCharWidthMap() {

View File

@ -26,11 +26,6 @@ public class SourceTextPanel extends JPanel {
this.textArea = new JTextArea(); this.textArea = new JTextArea();
this.textArea.setWrapStyleWord(true); this.textArea.setWrapStyleWord(true);
this.textArea.setLineWrap(true); this.textArea.setLineWrap(true);
try {
this.textArea.setText(Files.readString(Path.of(this.getClass().getClassLoader().getResource("sample/lorem_ipsum.txt").toURI())));
} catch (IOException | URISyntaxException e) {
e.printStackTrace();
}
JScrollPane scrollWrappedMainTextArea = new JScrollPane(this.textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); JScrollPane scrollWrappedMainTextArea = new JScrollPane(this.textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this.add(scrollWrappedMainTextArea, BorderLayout.CENTER); this.add(scrollWrappedMainTextArea, BorderLayout.CENTER);