Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
620794dc57 | ||
|
|
128eeec6b5 | ||
|
|
33468d5ded | ||
|
|
96e5bb9a7d | ||
|
|
6300b29ab5 | ||
|
|
a0e2cbf756 | ||
|
|
4a36d3e7f1 | ||
|
|
ab0d483cb1 | ||
|
|
cdd0514ca0 | ||
|
|
cf3091421f | ||
|
|
15fb3d15c0 | ||
|
|
45532ca9b7 | ||
|
|
6714bbb510 | ||
|
|
77f2314b24 | ||
|
|
dcd6390dbf | ||
|
|
ecac1dc8af | ||
|
|
b3174171c4 | ||
|
|
a0608bf032 | ||
|
|
c920eb1fe4 | ||
|
|
6cf1206716 | ||
|
|
dca8ed7392 | ||
|
|
55bdaef897 | ||
|
|
2cc9f0ba8c | ||
|
|
496c17276d | ||
|
|
6a54ea1cca | ||
|
|
3b79a5c93f | ||
|
|
f6e2a3b049 | ||
|
|
379c84c22e | ||
|
|
42e4ae298b | ||
|
|
f3b00c83ce | ||
|
|
fdcba3f6e6 | ||
|
|
24cb04cdef | ||
|
|
e47d2c91b1 | ||
|
|
ff0b574c45 | ||
|
|
279ca757d9 | ||
|
|
08d54e13c0 | ||
|
|
5aa6177b50 | ||
|
|
73c4e96359 | ||
|
|
cf1ac67cb0 | ||
|
|
0bb8133764 | ||
|
|
eb114d72f3 | ||
|
|
233d4ad054 | ||
|
|
6852ec1255 | ||
|
|
df51ca165b | ||
|
|
a59655d628 | ||
|
|
0aa0672815 | ||
|
|
1ecc83489b | ||
|
|
9bb5edd7d0 | ||
|
|
e084606ce8 | ||
|
|
e23c0090f4 | ||
|
|
4cd29b5230 | ||
|
|
3aba6aacc7 | ||
|
|
4723b864c4 | ||
|
|
0c61fa6c68 | ||
|
|
2d9642ff6f | ||
|
|
59ee8e5a48 | ||
|
|
e894471b0d | ||
|
|
b2fe8c3304 | ||
|
|
f2a0fc0d47 | ||
|
|
cdbfa1bab8 | ||
|
|
15bed6f696 | ||
|
|
318c4af68f | ||
|
|
c5004c3ff6 | ||
|
|
31c1adcee4 | ||
|
|
53f44f498c | ||
|
|
4258192f24 | ||
|
|
c59b3cdf27 | ||
|
|
687bc40097 | ||
|
|
ab211d6433 | ||
|
|
65108a0630 | ||
|
|
8c740a5062 | ||
|
|
8897c65b98 | ||
|
|
0a44d5c27a | ||
|
|
4cffd8e864 | ||
|
|
bff8bcf939 | ||
|
|
774982113a | ||
|
|
d1981c34e3 | ||
|
|
275e037ea2 | ||
|
|
3c85722c00 | ||
|
|
db4cd9bbbe | ||
|
|
b764aedb0c | ||
|
|
bfd648b34f | ||
|
|
8033d749c2 | ||
|
|
ddf2e28901 | ||
|
|
0e7e6ab934 | ||
|
|
f8da7923aa | ||
|
|
d3e58b823d | ||
|
|
f0ab3d0d79 | ||
|
|
316cb10ece | ||
|
|
f6f27986b2 | ||
|
|
5123218d6b | ||
|
|
3d4f430a6d | ||
|
|
bf13e341a4 | ||
|
|
26ca34ecde | ||
|
|
1689e39f6f | ||
|
|
ccc7be93f2 | ||
|
|
d603de9c69 | ||
|
|
f05c39b687 | ||
|
|
98ee3c97f8 | ||
|
|
db7c41e12a | ||
|
|
e75c81c071 | ||
|
|
9f8767f2b8 | ||
|
|
3fbc36a3e4 |
4
.gitignore
vendored
@@ -1,2 +1,6 @@
|
|||||||
demo/out/*
|
demo/out/*
|
||||||
demo/lib/*
|
demo/lib/*
|
||||||
|
demo/assets/*
|
||||||
|
out/*
|
||||||
|
lib/*
|
||||||
|
Terrarum-sans-bitmap*.zip
|
||||||
1
.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
|||||||
|
BuildJAR_TerrarumSansBitmap
|
||||||
11
.idea/artifacts/FontDemoGDX.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="FontDemoGDX">
|
||||||
|
<output-path>$PROJECT_DIR$/</output-path>
|
||||||
|
<root id="archive" name="FontDemoGDX.jar">
|
||||||
|
<element id="module-output" name="FontTestGDX" />
|
||||||
|
<element id="directory" name="META-INF">
|
||||||
|
<element id="file-copy" path="$PROJECT_DIR$/FontTestGDX/META-INF/MANIFEST.MF" />
|
||||||
|
</element>
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
12
.idea/artifacts/TerrarumSansBitmap.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="TerrarumSansBitmap">
|
||||||
|
<output-path>$PROJECT_DIR$/FontTestGDX/lib</output-path>
|
||||||
|
<root id="archive" name="TerrarumSansBitmap.jar">
|
||||||
|
<element id="module-output" name="BuildJAR_TerrarumSansBitmap" />
|
||||||
|
<element id="directory" name="META-INF">
|
||||||
|
<element id="file-copy" path="$PROJECT_DIR$/META-INF/MANIFEST.MF" />
|
||||||
|
</element>
|
||||||
|
<element id="dir-copy" path="$PROJECT_DIR$/src" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
9
.idea/codeStyles/Project.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<codeStyleSettings language="kotlin">
|
||||||
|
<option name="ELSE_ON_NEW_LINE" value="true" />
|
||||||
|
<option name="CATCH_ON_NEW_LINE" value="true" />
|
||||||
|
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
||||||
|
</codeStyleSettings>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
||||||
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
10
.idea/kotlinc.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Kotlin2JvmCompilerArguments">
|
||||||
|
<option name="jvmTarget" value="1.8" />
|
||||||
|
</component>
|
||||||
|
<component name="KotlinCommonCompilerArguments">
|
||||||
|
<option name="apiVersion" value="1.2" />
|
||||||
|
<option name="languageVersion" value="1.2" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
16
.idea/libraries/GdxLib.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="GdxLib">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$PROJECT_DIR$/lib" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<NATIVE>
|
||||||
|
<root url="file://$PROJECT_DIR$/lib" />
|
||||||
|
</NATIVE>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="file://$PROJECT_DIR$/lib" />
|
||||||
|
</SOURCES>
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" />
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" type="SOURCES" />
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@@ -3,15 +3,10 @@
|
|||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime.jar!/" />
|
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime.jar!/" />
|
||||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
|
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
|
||||||
<root url="file://$PROJECT_DIR$/lib" />
|
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<NATIVE>
|
|
||||||
<root url="file://$PROJECT_DIR$/lib" />
|
|
||||||
</NATIVE>
|
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime-sources.jar!/" />
|
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" />
|
|
||||||
</library>
|
</library>
|
||||||
</component>
|
</component>
|
||||||
10
.idea/libraries/TesterLib.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="TesterLib">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$PROJECT_DIR$/FontTestGDX/lib" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/FontTestGDX/lib" recursive="false" />
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
71
.idea/markdown-navigator.xml
generated
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="MarkdownProjectSettings">
|
||||||
|
<PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true" verticallyAlignSourceAndPreviewSyncPosition="true" showSearchHighlightsInPreview="false" showSelectionInPreview="true">
|
||||||
|
<PanelProvider>
|
||||||
|
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
|
||||||
|
</PanelProvider>
|
||||||
|
</PreviewSettings>
|
||||||
|
<ParserSettings gitHubSyntaxChange="false">
|
||||||
|
<PegdownExtensions>
|
||||||
|
<option name="ABBREVIATIONS" value="false" />
|
||||||
|
<option name="ANCHORLINKS" value="true" />
|
||||||
|
<option name="ASIDE" value="false" />
|
||||||
|
<option name="ATXHEADERSPACE" value="true" />
|
||||||
|
<option name="AUTOLINKS" value="true" />
|
||||||
|
<option name="DEFINITIONS" value="false" />
|
||||||
|
<option name="DEFINITION_BREAK_DOUBLE_BLANK_LINE" value="false" />
|
||||||
|
<option name="FENCED_CODE_BLOCKS" value="true" />
|
||||||
|
<option name="FOOTNOTES" value="false" />
|
||||||
|
<option name="HARDWRAPS" value="false" />
|
||||||
|
<option name="INSERTED" value="false" />
|
||||||
|
<option name="QUOTES" value="false" />
|
||||||
|
<option name="RELAXEDHRULES" value="true" />
|
||||||
|
<option name="SMARTS" value="false" />
|
||||||
|
<option name="STRIKETHROUGH" value="true" />
|
||||||
|
<option name="SUBSCRIPT" value="false" />
|
||||||
|
<option name="SUPERSCRIPT" value="false" />
|
||||||
|
<option name="SUPPRESS_HTML_BLOCKS" value="false" />
|
||||||
|
<option name="SUPPRESS_INLINE_HTML" value="false" />
|
||||||
|
<option name="TABLES" value="true" />
|
||||||
|
<option name="TASKLISTITEMS" value="true" />
|
||||||
|
<option name="TOC" value="false" />
|
||||||
|
<option name="WIKILINKS" value="true" />
|
||||||
|
</PegdownExtensions>
|
||||||
|
<ParserOptions>
|
||||||
|
<option name="COMMONMARK_LISTS" value="true" />
|
||||||
|
<option name="DUMMY" value="false" />
|
||||||
|
<option name="EMOJI_SHORTCUTS" value="true" />
|
||||||
|
<option name="FLEXMARK_FRONT_MATTER" value="false" />
|
||||||
|
<option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="false" />
|
||||||
|
<option name="GFM_TABLE_RENDERING" value="true" />
|
||||||
|
<option name="GITBOOK_URL_ENCODING" value="false" />
|
||||||
|
<option name="GITHUB_EMOJI_URL" value="false" />
|
||||||
|
<option name="GITHUB_LISTS" value="false" />
|
||||||
|
<option name="GITHUB_WIKI_LINKS" value="true" />
|
||||||
|
<option name="JEKYLL_FRONT_MATTER" value="false" />
|
||||||
|
<option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
|
||||||
|
</ParserOptions>
|
||||||
|
</ParserSettings>
|
||||||
|
<HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
|
||||||
|
<GeneratorProvider>
|
||||||
|
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
|
||||||
|
</GeneratorProvider>
|
||||||
|
<headerTop />
|
||||||
|
<headerBottom />
|
||||||
|
<bodyTop />
|
||||||
|
<bodyBottom />
|
||||||
|
</HtmlSettings>
|
||||||
|
<CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
|
||||||
|
<StylesheetProvider>
|
||||||
|
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
|
||||||
|
</StylesheetProvider>
|
||||||
|
<ScriptProviders />
|
||||||
|
<cssText />
|
||||||
|
</CssSettings>
|
||||||
|
<HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" />
|
||||||
|
<LinkMapSettings>
|
||||||
|
<textMaps />
|
||||||
|
</LinkMapSettings>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
3
.idea/markdown-navigator/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<component name="MarkdownNavigator.ProfileManager">
|
||||||
|
<settings default="" pdf-export="" />
|
||||||
|
</component>
|
||||||
0
demo/.idea/misc.xml → .idea/misc.xml
generated
9
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/BuildJAR_TerrarumSansBitmap.iml" filepath="$PROJECT_DIR$/BuildJAR_TerrarumSansBitmap.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" filepath="$PROJECT_DIR$/FontTestGDX/FontTestGDX.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
998
.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,998 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ArtifactsWorkspaceSettings">
|
||||||
|
<artifacts-to-build>
|
||||||
|
<artifact name="TerrarumSansBitmap" />
|
||||||
|
</artifacts-to-build>
|
||||||
|
</component>
|
||||||
|
<component name="ChangeListManager">
|
||||||
|
<list default="true" id="22c5bc80-996c-4846-b173-7dc8c2096fe3" name="Default" comment="">
|
||||||
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/CONTRIBUTING.md" beforeDir="false" afterPath="$PROJECT_DIR$/CONTRIBUTING.md" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FontTestGDX/demotext.txt" beforeDir="false" afterPath="$PROJECT_DIR$/FontTestGDX/demotext.txt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FontTestGDX/lib/TerrarumSansBitmap.jar" beforeDir="false" afterPath="$PROJECT_DIR$/FontTestGDX/lib/TerrarumSansBitmap.jar" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/assets/devanagari_bengali_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/devanagari_bengali_variable.tga" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/assets/thai_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/thai_variable.tga" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/demo.PNG" beforeDir="false" afterPath="$PROJECT_DIR$/demo.PNG" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/GlyphProps.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/GlyphProps.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt" afterDir="false" />
|
||||||
|
</list>
|
||||||
|
<ignored path="$PROJECT_DIR$/out/" />
|
||||||
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||||
|
<option name="TRACKING_ENABLED" value="true" />
|
||||||
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
|
</component>
|
||||||
|
<component name="FavoritesManager">
|
||||||
|
<favorites_list name="BuildJAR_TerrarumSansBitmap" />
|
||||||
|
</component>
|
||||||
|
<component name="FileEditorManager">
|
||||||
|
<splitter split-orientation="horizontal" split-proportion="0.5">
|
||||||
|
<split-first>
|
||||||
|
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||||
|
<file leaf-file-name="GameFontBase.kt" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="456">
|
||||||
|
<caret line="836" column="26" selection-start-line="836" selection-start-column="26" selection-end-line="836" selection-end-column="26" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="GlyphProps.kt" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/GlyphProps.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="156">
|
||||||
|
<caret line="12" column="33" selection-start-line="12" selection-start-column="12" selection-end-line="12" selection-end-column="33" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="demo.PNG" pinned="false" current-in-tab="true">
|
||||||
|
<entry file="file://$PROJECT_DIR$/demo.PNG">
|
||||||
|
<provider selected="true" editor-type-id="images" />
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="GameFontBase.kt" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="299">
|
||||||
|
<caret line="45" column="67" selection-start-line="45" selection-start-column="67" selection-end-line="45" selection-end-column="67" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
</leaf>
|
||||||
|
</split-first>
|
||||||
|
<split-second>
|
||||||
|
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||||
|
<file leaf-file-name="FontTestGDX.kt" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="547">
|
||||||
|
<caret line="128" column="31" lean-forward="true" selection-start-line="128" selection-start-column="31" selection-end-line="128" selection-end-column="31" />
|
||||||
|
<folding>
|
||||||
|
<element signature="e#0#384#0" expanded="true" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="demotext.txt" pinned="false" current-in-tab="true">
|
||||||
|
<entry file="file://$PROJECT_DIR$/FontTestGDX/demotext.txt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state>
|
||||||
|
<caret column="121" selection-start-column="121" selection-end-column="121" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="GameFontBase.kt" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="547">
|
||||||
|
<caret line="494" column="101" selection-start-line="494" selection-start-column="101" selection-end-line="494" selection-end-column="101" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="CONTRIBUTING.md" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/CONTRIBUTING.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||||
|
<state split_layout="FIRST">
|
||||||
|
<first_editor relative-caret-position="402">
|
||||||
|
<caret line="62" column="132" lean-forward="true" selection-start-line="62" selection-start-column="132" selection-end-line="62" selection-end-column="132" />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor>
|
||||||
|
<js_state />
|
||||||
|
</second_editor>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/README.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||||
|
<state split_layout="FIRST">
|
||||||
|
<first_editor relative-caret-position="325">
|
||||||
|
<caret line="25" column="97" selection-start-line="25" selection-start-column="97" selection-end-line="25" selection-end-column="97" />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor>
|
||||||
|
<js_state />
|
||||||
|
</second_editor>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
</leaf>
|
||||||
|
</split-second>
|
||||||
|
</splitter>
|
||||||
|
</component>
|
||||||
|
<component name="FileTemplateManagerImpl">
|
||||||
|
<option name="RECENT_TEMPLATES">
|
||||||
|
<list>
|
||||||
|
<option value="Kotlin Class" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="FindInProjectRecents">
|
||||||
|
<findStrings>
|
||||||
|
<find>getColour</find>
|
||||||
|
<find>.094</find>
|
||||||
|
<find>ө</find>
|
||||||
|
<find>ď</find>
|
||||||
|
<find>ñ</find>
|
||||||
|
<find>getSheetT</find>
|
||||||
|
<find>Unexpected</find>
|
||||||
|
<find>Unexp</find>
|
||||||
|
<find>fun getSh</find>
|
||||||
|
<find>codeRange</find>
|
||||||
|
<find>isHangul</find>
|
||||||
|
<find>Ᏽ</find>
|
||||||
|
<find>toColo</find>
|
||||||
|
<find>fun relo</find>
|
||||||
|
<find>3633</find>
|
||||||
|
<find>println(</find>
|
||||||
|
<find>Width ta</find>
|
||||||
|
<find>getWidth</find>
|
||||||
|
<find>glyphWidthBuffer</find>
|
||||||
|
<find>GlyphProps.LE</find>
|
||||||
|
<find>buildWidthTable</find>
|
||||||
|
<find>lastNonDiacriticChar</find>
|
||||||
|
<find>c.toInt()</find>
|
||||||
|
<find>har.toInt()</find>
|
||||||
|
<find>println</find>
|
||||||
|
<find>!!</find>
|
||||||
|
<find>ArrayList<Int></find>
|
||||||
|
<find>appConfig.height</find>
|
||||||
|
<find>textBuffer</find>
|
||||||
|
<find>no stan</find>
|
||||||
|
</findStrings>
|
||||||
|
<replaceStrings>
|
||||||
|
<replace>.141</replace>
|
||||||
|
<replace>c</replace>
|
||||||
|
<replace>har</replace>
|
||||||
|
<replace>TEXH</replace>
|
||||||
|
</replaceStrings>
|
||||||
|
</component>
|
||||||
|
<component name="Git.Settings">
|
||||||
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
|
<component name="IdeDocumentHistory">
|
||||||
|
<option name="CHANGED_PATHS">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/.gitignore" />
|
||||||
|
<option value="$PROJECT_DIR$/lib/slick.jar!/org/newdawn/slick/Color.class" />
|
||||||
|
<option value="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/testbed/FontTest.kt" />
|
||||||
|
<option value="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/testbed/FontTestGDX.kt" />
|
||||||
|
<option value="$PROJECT_DIR$/LICENSE.md" />
|
||||||
|
<option value="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt" />
|
||||||
|
<option value="$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt" />
|
||||||
|
<option value="$PROJECT_DIR$/README.md" />
|
||||||
|
<option value="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/GlyphProps.kt" />
|
||||||
|
<option value="$PROJECT_DIR$/CONTRIBUTING.md" />
|
||||||
|
<option value="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt" />
|
||||||
|
<option value="$PROJECT_DIR$/FontTestGDX/demotext.txt" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectFrameBounds" extendedState="6">
|
||||||
|
<option name="x" value="-8" />
|
||||||
|
<option name="y" value="-8" />
|
||||||
|
<option name="width" value="1936" />
|
||||||
|
<option name="height" value="1216" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectView">
|
||||||
|
<navigator proportions="" version="1">
|
||||||
|
<foldersAlwaysOnTop value="true" />
|
||||||
|
</navigator>
|
||||||
|
<panes>
|
||||||
|
<pane id="PackagesPane" />
|
||||||
|
<pane id="ProjectPane">
|
||||||
|
<subPane>
|
||||||
|
<expand>
|
||||||
|
<path>
|
||||||
|
<item name="BuildJAR_TerrarumSansBitmap" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="Terrarum-sans-bitmap" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<item name="BuildJAR_TerrarumSansBitmap" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="Terrarum-sans-bitmap" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="FontTestGDX" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<item name="BuildJAR_TerrarumSansBitmap" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="Terrarum-sans-bitmap" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="FontTestGDX" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<item name="BuildJAR_TerrarumSansBitmap" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="Terrarum-sans-bitmap" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<item name="BuildJAR_TerrarumSansBitmap" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="Terrarum-sans-bitmap" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="terrarumsansbitmap" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
</expand>
|
||||||
|
<select />
|
||||||
|
</subPane>
|
||||||
|
</pane>
|
||||||
|
<pane id="Scope" />
|
||||||
|
</panes>
|
||||||
|
</component>
|
||||||
|
<component name="PropertiesComponent">
|
||||||
|
<property name="SearchEverywhereHistoryKey" value="soft wr	ACTION	EditorToggleUseSoftWraps" />
|
||||||
|
<property name="last_opened_file_path" value="$PROJECT_DIR$/FontTestGDX" />
|
||||||
|
<property name="project.structure.last.edited" value="Artifacts" />
|
||||||
|
<property name="project.structure.proportion" value="0.15" />
|
||||||
|
<property name="project.structure.side.proportion" value="0.32068965" />
|
||||||
|
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
|
||||||
|
</component>
|
||||||
|
<component name="RecentsManager">
|
||||||
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
|
<recent name="C:\Users\minjaesong\Documents\Terrarum-sans-bitmap\FontTestGDX\src" />
|
||||||
|
</key>
|
||||||
|
</component>
|
||||||
|
<component name="RunDashboard">
|
||||||
|
<option name="ruleStates">
|
||||||
|
<list>
|
||||||
|
<RuleState>
|
||||||
|
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||||
|
</RuleState>
|
||||||
|
<RuleState>
|
||||||
|
<option name="name" value="StatusDashboardGroupingRule" />
|
||||||
|
</RuleState>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="RunManager">
|
||||||
|
<configuration default="true" type="Applet" factoryName="Applet">
|
||||||
|
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="Application" factoryName="Application">
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="JUnit" factoryName="JUnit">
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="PACKAGE_NAME" />
|
||||||
|
<option name="MAIN_CLASS_NAME" />
|
||||||
|
<option name="METHOD_NAME" />
|
||||||
|
<option name="TEST_OBJECT" value="class" />
|
||||||
|
<option name="VM_PARAMETERS" value="-ea" />
|
||||||
|
<option name="PARAMETERS" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<option name="TEST_SEARCH_SCOPE">
|
||||||
|
<value defaultName="singleModule" />
|
||||||
|
</option>
|
||||||
|
<patterns />
|
||||||
|
</configuration>
|
||||||
|
<configuration name="FontTestGDXKt" type="JetRunConfigurationType" factoryName="Kotlin" temporary="true">
|
||||||
|
<module name="FontTestGDX" />
|
||||||
|
<option name="VM_PARAMETERS" value="" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<option name="MAIN_CLASS_NAME" value="FontTestGDXKt" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="" />
|
||||||
|
<method>
|
||||||
|
<option name="BuildArtifacts" enabled="true">
|
||||||
|
<artifact name="TerrarumSansBitmap" />
|
||||||
|
</option>
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script">
|
||||||
|
<option name="filePath" />
|
||||||
|
<option name="vmParameters" />
|
||||||
|
<option name="alternativeJrePath" />
|
||||||
|
<option name="programParameters" />
|
||||||
|
<option name="passParentEnvs" value="true" />
|
||||||
|
<option name="workingDirectory" />
|
||||||
|
<option name="isAlternativeJrePathEnabled" value="false" />
|
||||||
|
<option name="VM_PARAMETERS" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<option name="MAIN_CLASS_NAME" />
|
||||||
|
<option name="WORKING_DIRECTORY" />
|
||||||
|
<module name="" />
|
||||||
|
<option name="filePath" />
|
||||||
|
<option name="vmParameters" />
|
||||||
|
<option name="alternativeJrePath" />
|
||||||
|
<option name="programParameters" />
|
||||||
|
<option name="passParentEnvs" value="true" />
|
||||||
|
<option name="workingDirectory" />
|
||||||
|
<option name="isAlternativeJrePathEnabled" value="false" />
|
||||||
|
<option name="VM_PARAMETERS" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<option name="MAIN_CLASS_NAME" />
|
||||||
|
<option name="WORKING_DIRECTORY" />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="TestNG" factoryName="TestNG">
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="SUITE_NAME" />
|
||||||
|
<option name="PACKAGE_NAME" />
|
||||||
|
<option name="MAIN_CLASS_NAME" />
|
||||||
|
<option name="METHOD_NAME" />
|
||||||
|
<option name="GROUP_NAME" />
|
||||||
|
<option name="TEST_OBJECT" value="CLASS" />
|
||||||
|
<option name="VM_PARAMETERS" value="-ea" />
|
||||||
|
<option name="PARAMETERS" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
||||||
|
<option name="OUTPUT_DIRECTORY" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<option name="TEST_SEARCH_SCOPE">
|
||||||
|
<value defaultName="singleModule" />
|
||||||
|
</option>
|
||||||
|
<option name="USE_DEFAULT_REPORTERS" value="false" />
|
||||||
|
<option name="PROPERTIES_FILE" />
|
||||||
|
<properties />
|
||||||
|
<listeners />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
|
||||||
|
<ExternalSystemSettings>
|
||||||
|
<option name="executionName" />
|
||||||
|
<option name="externalProjectPath" />
|
||||||
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
|
<option name="scriptParameters" />
|
||||||
|
<option name="taskDescriptions">
|
||||||
|
<list />
|
||||||
|
</option>
|
||||||
|
<option name="taskNames">
|
||||||
|
<list />
|
||||||
|
</option>
|
||||||
|
<option name="vmOptions" />
|
||||||
|
</ExternalSystemSettings>
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="JarApplication" factoryName="JAR Application">
|
||||||
|
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||||
|
<envs />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="Java Scratch" factoryName="Java Scratch">
|
||||||
|
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||||
|
<option name="SCRATCH_FILE_ID" value="0" />
|
||||||
|
<option name="MAIN_CLASS_NAME" />
|
||||||
|
<option name="VM_PARAMETERS" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" />
|
||||||
|
<option name="WORKING_DIRECTORY" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
||||||
|
<option name="ENV_VARIABLES" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<module name="" />
|
||||||
|
<envs />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
|
||||||
|
<module name="BuildJAR_TerrarumSansBitmap" />
|
||||||
|
<option name="VM_PARAMETERS" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<option name="MAIN_CLASS_NAME" />
|
||||||
|
<option name="WORKING_DIRECTORY" />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="Remote" factoryName="Remote">
|
||||||
|
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||||
|
<option name="SERVER_MODE" value="false" />
|
||||||
|
<option name="SHMEM_ADDRESS" value="javadebug" />
|
||||||
|
<option name="HOST" value="localhost" />
|
||||||
|
<option name="PORT" value="5005" />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||||
|
<module name="" />
|
||||||
|
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" />
|
||||||
|
<predefined_log_file id="idea.log" enabled="true" />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="executeSpecs" factoryName="Gauge Execution">
|
||||||
|
<setting name="environment" value="" />
|
||||||
|
<setting name="specsToExecute" value="" />
|
||||||
|
<setting name="tags" value="" />
|
||||||
|
<setting name="parallelNodes" value="" />
|
||||||
|
<setting name="execInParallel" value="false" />
|
||||||
|
<setting name="programParameters" value="" />
|
||||||
|
<setting name="workingDirectory" value="" />
|
||||||
|
<setting name="moduleName" value="" />
|
||||||
|
<envMap />
|
||||||
|
<setting name="rowsRange" value="" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<recent_temporary>
|
||||||
|
<list>
|
||||||
|
<item itemvalue="Kotlin.FontTestGDXKt" />
|
||||||
|
</list>
|
||||||
|
</recent_temporary>
|
||||||
|
</component>
|
||||||
|
<component name="SvnConfiguration">
|
||||||
|
<configuration />
|
||||||
|
</component>
|
||||||
|
<component name="TaskManager">
|
||||||
|
<task active="true" id="Default" summary="Default task">
|
||||||
|
<changelist id="22c5bc80-996c-4846-b173-7dc8c2096fe3" name="Default" comment="" />
|
||||||
|
<created>1497950823354</created>
|
||||||
|
<option name="number" value="Default" />
|
||||||
|
<option name="presentableId" value="Default" />
|
||||||
|
<updated>1497950823354</updated>
|
||||||
|
</task>
|
||||||
|
<servers />
|
||||||
|
</component>
|
||||||
|
<component name="TodoView">
|
||||||
|
<todo-panel id="selected-file">
|
||||||
|
<is-autoscroll-to-source value="true" />
|
||||||
|
</todo-panel>
|
||||||
|
<todo-panel id="all">
|
||||||
|
<are-packages-shown value="true" />
|
||||||
|
<is-autoscroll-to-source value="true" />
|
||||||
|
</todo-panel>
|
||||||
|
</component>
|
||||||
|
<component name="ToolWindowManager">
|
||||||
|
<frame x="-8" y="-8" width="1936" height="1216" extended-state="6" />
|
||||||
|
<editor active="true" />
|
||||||
|
<layout>
|
||||||
|
<window_info anchor="right" id="Palette" order="3" />
|
||||||
|
<window_info anchor="bottom" id="TODO" order="6" />
|
||||||
|
<window_info anchor="bottom" id="Messages" order="7" weight="0.3283859" />
|
||||||
|
<window_info anchor="right" id="Palette	" order="3" />
|
||||||
|
<window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
|
||||||
|
<window_info anchor="right" id="Maven Projects" order="3" />
|
||||||
|
<window_info anchor="bottom" id="Run" order="2" weight="0.2591522" />
|
||||||
|
<window_info anchor="bottom" id="Version Control" order="7" />
|
||||||
|
<window_info anchor="bottom" id="Terminal" order="7" />
|
||||||
|
<window_info id="Designer" order="2" />
|
||||||
|
<window_info content_ui="combo" id="Project" order="0" weight="0.13859275" />
|
||||||
|
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
||||||
|
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
|
||||||
|
<window_info id="UI Designer" order="2" />
|
||||||
|
<window_info active="true" anchor="bottom" id="Debug" order="3" visible="true" weight="0.23005566" />
|
||||||
|
<window_info id="Favorites" order="2" side_tool="true" />
|
||||||
|
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
||||||
|
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
||||||
|
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
|
||||||
|
<window_info anchor="bottom" id="Message" order="0" />
|
||||||
|
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||||
|
<window_info anchor="bottom" id="Find" order="1" weight="0.32931355" />
|
||||||
|
</layout>
|
||||||
|
<layout-to-restore>
|
||||||
|
<window_info anchor="right" id="Palette" order="3" />
|
||||||
|
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
||||||
|
<window_info anchor="bottom" id="Version Control" order="9" />
|
||||||
|
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.1369936" />
|
||||||
|
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
||||||
|
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
|
||||||
|
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
|
||||||
|
<window_info anchor="bottom" id="TODO" order="6" />
|
||||||
|
<window_info anchor="bottom" id="Run" order="2" weight="0.2591522" />
|
||||||
|
<window_info anchor="bottom" id="Find" order="1" />
|
||||||
|
<window_info id="Designer" order="2" />
|
||||||
|
<window_info id="UI Designer" order="3" />
|
||||||
|
<window_info active="true" anchor="bottom" id="Debug" order="3" visible="true" weight="0.23005566" />
|
||||||
|
<window_info anchor="right" id="Palette	" order="4" />
|
||||||
|
<window_info anchor="bottom" id="Terminal" order="7" />
|
||||||
|
<window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
|
||||||
|
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
||||||
|
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||||
|
<window_info anchor="bottom" id="Message" order="0" />
|
||||||
|
<window_info anchor="bottom" id="Messages" order="10" weight="0.3283859" />
|
||||||
|
<window_info anchor="right" id="Maven Projects" order="5" />
|
||||||
|
<window_info id="Favorites" order="4" side_tool="true" />
|
||||||
|
</layout-to-restore>
|
||||||
|
</component>
|
||||||
|
<component name="VcsContentAnnotationSettings">
|
||||||
|
<option name="myLimit" value="2678400000" />
|
||||||
|
</component>
|
||||||
|
<component name="XDebuggerManager">
|
||||||
|
<breakpoint-manager>
|
||||||
|
<option name="time" value="1" />
|
||||||
|
</breakpoint-manager>
|
||||||
|
</component>
|
||||||
|
<component name="antWorkspaceConfiguration">
|
||||||
|
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
|
||||||
|
<option name="FILTER_TARGETS" value="false" />
|
||||||
|
</component>
|
||||||
|
<component name="editorHistoryManager">
|
||||||
|
<entry file="file://$PROJECT_DIR$/README.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="1404">
|
||||||
|
<caret line="108" selection-start-line="108" selection-end-line="108" />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor>
|
||||||
|
<js_state />
|
||||||
|
</second_editor>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="6071">
|
||||||
|
<caret line="531" column="21" selection-start-line="531" selection-start-column="21" selection-end-line="531" selection-end-column="21" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/CONTRIBUTING.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="234">
|
||||||
|
<caret line="18" lean-forward="true" selection-start-line="18" selection-end-line="18" />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor>
|
||||||
|
<js_state />
|
||||||
|
</second_editor>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1638">
|
||||||
|
<caret line="134" column="40" selection-start-line="134" selection-start-column="40" selection-end-line="134" selection-end-column="40" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/FontTestGDX/demotext.txt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state>
|
||||||
|
<caret selection-end-line="1" selection-end-column="43" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1625">
|
||||||
|
<caret line="155" column="48" selection-start-line="155" selection-start-column="48" selection-end-line="155" selection-end-column="48" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/README.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="1404">
|
||||||
|
<caret line="108" lean-forward="true" selection-start-line="108" selection-end-line="108" />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor>
|
||||||
|
<js_state />
|
||||||
|
</second_editor>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="6071">
|
||||||
|
<caret line="531" column="21" selection-start-line="531" selection-start-column="21" selection-end-line="531" selection-end-column="21" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1638">
|
||||||
|
<caret line="134" column="40" selection-start-line="134" selection-start-column="40" selection-end-line="134" selection-end-column="40" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/FontTestGDX/demotext.txt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state>
|
||||||
|
<caret selection-end-line="1" selection-end-column="43" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1495">
|
||||||
|
<caret line="145" column="17" selection-start-line="145" selection-start-column="17" selection-end-line="145" selection-end-column="17" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/README.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||||
|
<state split_layout="SECOND">
|
||||||
|
<first_editor relative-caret-position="143">
|
||||||
|
<caret line="11" column="153" selection-start-line="11" selection-start-column="153" selection-end-line="11" selection-end-column="153" />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor>
|
||||||
|
<js_state />
|
||||||
|
</second_editor>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="8905">
|
||||||
|
<caret line="749" column="35" selection-start-line="749" selection-start-column="35" selection-end-line="749" selection-end-column="35" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="9594">
|
||||||
|
<caret line="768" column="40" selection-start-line="768" selection-start-column="40" selection-end-line="768" selection-end-column="40" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="9269">
|
||||||
|
<caret line="777" lean-forward="true" selection-start-line="777" selection-end-line="777" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="4940">
|
||||||
|
<caret line="410" lean-forward="true" selection-start-line="410" selection-end-line="410" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="5148">
|
||||||
|
<caret line="426" column="56" selection-start-line="426" selection-start-column="56" selection-end-line="426" selection-end-column="56" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="4752">
|
||||||
|
<caret line="426" column="56" selection-start-line="426" selection-start-column="56" selection-end-line="426" selection-end-column="56" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="7692">
|
||||||
|
<caret line="704" column="13" selection-start-line="704" selection-start-column="13" selection-end-line="704" selection-end-column="13" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="8974">
|
||||||
|
<caret line="704" column="13" selection-start-line="704" selection-start-column="13" selection-end-line="704" selection-end-column="13" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="8974">
|
||||||
|
<caret line="704" column="13" selection-start-line="704" selection-start-column="13" selection-end-line="704" selection-end-column="13" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="8974">
|
||||||
|
<caret line="704" column="13" selection-start-line="704" selection-start-column="13" selection-end-line="704" selection-end-column="13" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="8974">
|
||||||
|
<caret line="704" column="13" selection-start-line="704" selection-start-column="13" selection-end-line="704" selection-end-column="13" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="8974">
|
||||||
|
<caret line="704" column="13" selection-start-line="704" selection-start-column="13" selection-end-line="704" selection-end-column="13" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="8974">
|
||||||
|
<caret line="704" column="13" selection-start-line="704" selection-start-column="13" selection-end-line="704" selection-end-column="13" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="112">
|
||||||
|
<caret line="40" column="2" selection-start-line="40" selection-start-column="2" selection-end-line="40" selection-end-column="2" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="336">
|
||||||
|
<caret line="24" column="14" selection-start-line="24" selection-start-column="14" selection-end-line="24" selection-end-column="14" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="112">
|
||||||
|
<caret line="40" column="2" selection-start-line="40" selection-start-column="2" selection-end-line="40" selection-end-column="2" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="28">
|
||||||
|
<caret line="24" column="14" selection-start-line="24" selection-start-column="14" selection-end-line="24" selection-end-column="14" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="504">
|
||||||
|
<caret line="43" column="39" selection-start-line="43" selection-start-column="39" selection-end-line="43" selection-end-column="39" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="532">
|
||||||
|
<caret line="67" column="39" selection-start-line="67" selection-start-column="39" selection-end-line="67" selection-end-column="39" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/.gitignore">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="56">
|
||||||
|
<caret line="4" column="5" selection-start-line="4" selection-start-column="5" selection-end-line="4" selection-end-column="5" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="jar://$PROJECT_DIR$/lib/slick.jar!/org/newdawn/slick/Color.class" />
|
||||||
|
<entry file="file://$PROJECT_DIR$/LICENSE.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="26">
|
||||||
|
<caret line="2" column="23" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor>
|
||||||
|
<js_state />
|
||||||
|
</second_editor>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="jar://$PROJECT_DIR$/FontTestGDX/lib/TerrarumSansBitmap.jar!/net/torvald/terrarumsansbitmap/gdx/GameFontBase.class">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="513">
|
||||||
|
<caret line="308" column="21" selection-start-line="308" selection-start-column="21" selection-end-line="308" selection-end-column="21" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/readme.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor />
|
||||||
|
<second_editor>
|
||||||
|
<js_state />
|
||||||
|
</second_editor>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="jar://$PROJECT_DIR$/lib/gdx.jar!/com/badlogic/gdx/graphics/g2d/GlyphLayout.class">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="156">
|
||||||
|
<caret line="23" column="11" selection-start-line="23" selection-start-column="11" selection-end-line="23" selection-end-column="11" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="jar://C:/Program Files/Java/jdk1.8.0_131/src.zip!/java/lang/Character.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="515">
|
||||||
|
<caret line="4839" column="59" selection-start-line="4837" selection-start-column="15" selection-end-line="4839" selection-end-column="59" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="jar://C:/Program Files/Java/jdk1.8.0_131/src.zip!/java/lang/CharSequence.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="509">
|
||||||
|
<caret line="219" column="49" selection-start-line="219" selection-start-column="49" selection-end-line="219" selection-end-column="49" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="jar://$KOTLIN_BUNDLED$/lib/kotlin-runtime-sources.jar!/kotlin/CharSequence.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="91">
|
||||||
|
<caret line="21" column="17" selection-start-line="21" selection-start-column="17" selection-end-line="21" selection-end-column="17" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="jar://$PROJECT_DIR$/lib/gdx.jar!/com/badlogic/gdx/graphics/glutils/GLFrameBuffer.class">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="2379">
|
||||||
|
<caret line="205" column="13" selection-start-line="205" selection-start-column="13" selection-end-line="205" selection-end-column="13" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="jar://$PROJECT_DIR$/FontTestGDX/lib/TerrarumSansBitmap.jar!/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="390">
|
||||||
|
<caret line="448" column="21" lean-forward="true" selection-start-line="448" selection-start-column="21" selection-end-line="448" selection-end-column="21" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="jar://$PROJECT_DIR$/lib/gdx.jar!/com/badlogic/gdx/utils/ScreenUtils.class">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="272">
|
||||||
|
<caret line="38" column="25" selection-start-line="38" selection-start-column="25" selection-end-line="38" selection-end-column="25" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="299">
|
||||||
|
<caret line="45" column="67" selection-start-line="45" selection-start-column="67" selection-end-line="45" selection-end-column="67" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/README.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||||
|
<state split_layout="FIRST">
|
||||||
|
<first_editor relative-caret-position="325">
|
||||||
|
<caret line="25" column="97" selection-start-line="25" selection-start-column="97" selection-end-line="25" selection-end-column="97" />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor>
|
||||||
|
<js_state />
|
||||||
|
</second_editor>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/GlyphProps.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="156">
|
||||||
|
<caret line="12" column="33" selection-start-line="12" selection-start-column="12" selection-end-line="12" selection-end-column="33" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/CONTRIBUTING.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||||
|
<state split_layout="FIRST">
|
||||||
|
<first_editor relative-caret-position="402">
|
||||||
|
<caret line="62" column="132" lean-forward="true" selection-start-line="62" selection-start-column="132" selection-end-line="62" selection-end-column="132" />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor>
|
||||||
|
<js_state />
|
||||||
|
</second_editor>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="547">
|
||||||
|
<caret line="494" column="101" selection-start-line="494" selection-start-column="101" selection-end-line="494" selection-end-column="101" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="547">
|
||||||
|
<caret line="128" column="31" lean-forward="true" selection-start-line="128" selection-start-column="31" selection-end-line="128" selection-end-column="31" />
|
||||||
|
<folding>
|
||||||
|
<element signature="e#0#384#0" expanded="true" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/demo.PNG">
|
||||||
|
<provider selected="true" editor-type-id="images" />
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/FontTestGDX/demotext.txt">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state>
|
||||||
|
<caret column="121" selection-start-column="121" selection-end-column="121" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</component>
|
||||||
|
<component name="masterDetails">
|
||||||
|
<states>
|
||||||
|
<state key="ArtifactsStructureConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<artifact-editor />
|
||||||
|
<last-edited>FontDemoGDX</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.32068965" />
|
||||||
|
<option value="0.5" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="FacetStructureConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>No facets are configured</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.32068965" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="GlobalLibrariesConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="JdkListConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>1.8</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="ModuleStructureConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>FontTestGDX</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.32068965" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="ProjectLibrariesConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>TesterLib</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.32068965" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
</states>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
13
BuildJAR_TerrarumSansBitmap.iml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||||
|
<orderEntry type="library" name="GdxLib" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
145
CONTRIBUTING.md
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
You can contribute to the font by fixing wrong glyphs, suggesting better ones, extending character set (letters for other writing systems or filling in the blanks on the existing ones), or code for other game frameworks (not limited to Java). Please leave pull request for that.
|
||||||
|
|
||||||
|
Font Spritesheets are stored in ```assets/graphics/fonts``` directory. Image format must be TGA with Alpha — no PNG. If someone needs PNG, they can batch-convert the font using utils like ImageMagick.
|
||||||
|
|
||||||
|
|
||||||
|
#### Before getting started, you did read our design goals, right? Good. Now you may continue your awesome work.
|
||||||
|
|
||||||
|
### Ascenders, descenders, width informations
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Above image is a reference you can use while you draw some letters. Capital B is drawn as a reference. Orange-tinted area is for lowercase, x-height must be the same as that of said tinted area (lowercase Alpha is also drawn for the reference). NOTE THAT x-height is taller than centre bar (capital A is an exception). Height of the ascender of the lowercase letters must be the same as height of capital letters.
|
||||||
|
|
||||||
|
Red-tinted area SHOULD NOT CONTAIN any dots, it's emptied for compatibility. (Slick2d—you can define size of "gaps" of the spritesheet, but you can't define horizontal and vertical gap separately)
|
||||||
|
|
||||||
|
Blue-tinted area cotains width of the glyph in binary, uppermost dot is the Least Significant Bit.
|
||||||
|
|
||||||
|
Green-tinted area contains extra informations, left blank for most cases. We'll call it Glyph Tags.
|
||||||
|
|
||||||
|
Tinted-in-magenta shows the height where diacritics should be placed, for both uppercase and lowercase.
|
||||||
|
|
||||||
|
Each cell is 16 px wide, and any glyph you draw **must be contained within leftside FIFTEEN pixels**.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Font Metrics
|
||||||
|
|
||||||
|
Although the font is basically a Spritesheet, some of the sheet expects variable widths to be supported. Any sheets with ```_variable``` means it expects variable widths. Anything else expects fixed width (regular Spritesheet behaviour). ```cjkpunct``` has width of 10, ```kana``` and ```hangul_johab``` has width of 12, ```wenquanyi``` has width of 16.
|
||||||
|
|
||||||
|
### Parsing glyph widths for variable font sheets
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Width is encoded in binary bits, on pixels. On the font spritesheet, every glyph has vertical dots on their top-right side (to be exact, every (16k - 1)th pixel on x axis). Above image is a sample of the font, with width information coloured in magenta. From top to bottom, each dot represents 1, 2, 4 and 8. For example, in the above image, ! (exclamation mark) has width of 5, " (double quote) has width of 6, # (octothorp) has width of 8, $ (dollar sign) has width of 9.
|
||||||
|
|
||||||
|
### Glyph Tagging System
|
||||||
|
|
||||||
|
Green-tinted area (should be 10 px tall) contains the tags. Tags are defined as following:
|
||||||
|
|
||||||
|
```
|
||||||
|
(LSB) 0 == RTL
|
||||||
|
1 -+ 1 | Align to this X pos of prev char,
|
||||||
|
1 | 2 | only valid if write-on-top is 1
|
||||||
|
1 | 4 | and is centre-aligned and non-zero
|
||||||
|
1 -+ 8 | (if this is zero, floorOf(width/2) will be used instead)
|
||||||
|
0 -+ 0 Align 1 Align 0 Align 1 Align before
|
||||||
|
1 -+ 0 left 0 right 1 centre 1 the glyph
|
||||||
|
0 == Write on top of prev chars (e.g. diacritics)
|
||||||
|
1 == Diacritics stack 0:upward/1:downward
|
||||||
|
(MSB) X == undefined, should be 0
|
||||||
|
|
||||||
|
NOTE: If glyphs are right or centre aligned, they must be aligned in the
|
||||||
|
same way inside of the bitmap; the program assumes every variable-
|
||||||
|
width glyphs to have a width of 15, regardless of the tagged width.
|
||||||
|
If the diacritic is aligned before the glyph, the diacritic itself
|
||||||
|
is always assumed as left-aligned, as this font will swap position
|
||||||
|
of said diacritic and the glyph right before it.
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
(fun fact: it was drawn on Rhodia memopad with Lamy 2000, then photographed and edited on my iPhone. Letter used is a Cherokee WE Ꮺ)
|
||||||
|
|
||||||
|
### Implementing the Korean writing system
|
||||||
|
|
||||||
|
On this font, Hangul letters are printed by assemblying two or three letter pieces. There are 10 sets of Hangul letter pieces on the font. Top 6 are initials, middle 2 are medials, and bottom 2 are finals. On the rightmost side, there's eight assembled glyphs to help you with (assuming you have basic knowledge on the writing system). Top 6 tells you how to use 6 initials, and bottom 2 tells you how to use 2 finals.
|
||||||
|
|
||||||
|
This is a Kotlin-like pseudocode for assembling the glyph:
|
||||||
|
|
||||||
|
function getHanChosung(hanIndex: Int) = hanIndex / (21 * 28)
|
||||||
|
function getHanJungseong(hanIndex: Int) = hanIndex / 28 % 21
|
||||||
|
function getHanJongseong(hanIndex: Int) = hanIndex % 28
|
||||||
|
|
||||||
|
jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
|
||||||
|
jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
|
||||||
|
|
||||||
|
function getHanInitialRow(hanIndex: Int): Int {
|
||||||
|
val ret: Int
|
||||||
|
|
||||||
|
if (isJungseongWide(hanIndex))
|
||||||
|
ret = 2
|
||||||
|
else if (isJungseongComplex(hanIndex))
|
||||||
|
ret = 4
|
||||||
|
else
|
||||||
|
ret = 0
|
||||||
|
|
||||||
|
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
|
||||||
|
function isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
|
||||||
|
|
||||||
|
function getHanInitialRow(hanIndex: Int): Int {
|
||||||
|
val ret: Int
|
||||||
|
|
||||||
|
if (isJungseongWide(hanIndex))
|
||||||
|
ret = 2
|
||||||
|
else if (isJungseongComplex(hanIndex))
|
||||||
|
ret = 4
|
||||||
|
else
|
||||||
|
ret = 0
|
||||||
|
|
||||||
|
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
|
||||||
|
|
||||||
|
function getHanFinalRow(hanIndex: Int): Int {
|
||||||
|
val jungseongIndex = getHanJungseong(hanIndex)
|
||||||
|
|
||||||
|
return if (jungseongWide.contains(jungseongIndex))
|
||||||
|
8
|
||||||
|
else
|
||||||
|
9
|
||||||
|
}
|
||||||
|
|
||||||
|
function isHangul(c: Char) = c.toInt() >= 0xAC00 && c.toInt() < 0xD7A4
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
for (each Char on the string) {
|
||||||
|
if (isHangul(Char)) {
|
||||||
|
val hIndex = Char.toInt() - 0xAC00
|
||||||
|
|
||||||
|
val indexCho = getHanChosung(hIndex)
|
||||||
|
val indexJung = getHanJungseong(hIndex)
|
||||||
|
val indexJong = getHanJongseong(hIndex)
|
||||||
|
|
||||||
|
val choRow = getHanInitialRow(hIndex)
|
||||||
|
val jungRow = getHanMedialRow(hIndex)
|
||||||
|
val jongRow = getHanFinalRow(hIndex)
|
||||||
|
|
||||||
|
// get sub image from sprite sheet
|
||||||
|
val choseongImage = hangulSheet.getSubImage(indexCho, choRow)
|
||||||
|
val jungseongImage = hangulSheet.getSubImage(indexJung, jungRow)
|
||||||
|
val jongseongImage = hangulSheet.getSubImage(indexJong, jongRow)
|
||||||
|
|
||||||
|
// actual drawing part
|
||||||
|
draw choseongImage to somewhere you want
|
||||||
|
draw jungseongImage on top of choseongImage
|
||||||
|
draw jongseongImage on top of choseongImage
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
BIN
FontDemoGDX.jar
Normal file
14
FontTestGDX/FontTestGDX.iml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||||
|
<orderEntry type="library" name="GdxLib" level="project" />
|
||||||
|
<orderEntry type="library" name="TesterLib" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
6
FontTestGDX/META-INF/MANIFEST.MF
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Class-Path: lib/gdx.jar lib/gdx-backend-lwjgl.jar lib/gdx-backend-lwjg
|
||||||
|
l-natives.jar lib/gdx-natives.jar lib/kotlin-stdlib.jar TerrarumSansB
|
||||||
|
itmap.jar
|
||||||
|
Main-Class: FontTestGDXKt
|
||||||
|
|
||||||
102
FontTestGDX/demotext.txt
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
The bitmap font for games developers who seek good font that has real multilingual support,
|
||||||
|
for free (as in freedom and without cost)
|
||||||
|
|
||||||
|
There are many bitmap fonts on the internet. You care for the multilingual support, but alas!
|
||||||
|
most of them do not support your language, vector fonts take too much time to load, and even
|
||||||
|
then their legibility suffers because fuck built-in antialias.
|
||||||
|
|
||||||
|
You somehow found a multilingual one, and it makes your game look like an old computer, and you say:
|
||||||
|
|
||||||
|
“Well, better than nothing… no, it’s ugly.”
|
||||||
|
|
||||||
|
You speak japanese and you wish to support it, but then このクソなfont only goot for displaying
|
||||||
|
Japanese, it's not even multilingual, and their English look uncanny and inconsistent as hell.
|
||||||
|
|
||||||
|
Eventually you just mix different fonts together, and the results were always infuriating.
|
||||||
|
|
||||||
|
No more suffering. This font has everything you need.
|
||||||
|
|
||||||
|
while (isVisible(BAD_FONTS)) {
|
||||||
|
ripAndTear(BAD_FONTS).where { GUTS };
|
||||||
|
}
|
||||||
|
|
||||||
|
How multilingual? Real multilingual!
|
||||||
|
|
||||||
|
Ианҵоуп ақьаад, нусхур аҩырала, ҩ ҽшьаҟакла, иҧшӡоу анапҩырала
|
||||||
|
գրիչս վայր դրի, վեր կացա և պատրաստվում էի, որ քնեմ, երբ հանկարծ դռանս զանգակը հնչեց
|
||||||
|
ՄՇԱԿԻՉ ԿԱՄ ԿԵՆՏՐՈՆԱԿԱՆ ՄՇԱԿԻՉ ՀԱՆԳՈՒՅՑԸ ՀԱՆԴԻՍԱՆՈՒՄ Է ՀԱՄԱԿԱՐԳՉԻ ՍԱՐՔԱՎՈՐՈՒՄՆԵՐԻՑ
|
||||||
|
Zəfər, jaketini də papağını da götür, bu axşam hava çox soyuq olacaq
|
||||||
|
Под южно дърво, цъфтящо в синьо, бягаше малко пухкаво зайче
|
||||||
|
ᎠᏍᎦᏯᎡᎦᎢᎾᎨᎢᎣᏍᏓᎤᎩᏍᏗᎥᎴᏓᎯᎲᎢᏔᎵᏕᎦᏟᏗᏖᎸᎳᏗᏗᎧᎵᎢᏘᎴᎩ ᏙᏱᏗᏜᏫᏗᏣᏚᎦᏫᏛᏄᏓᎦᏝᏃᎠᎾᏗᎭᏞᎦᎯᎦᏘᏓᏠᎨᏏᏕᏡᎬᏢᏓᏥᏩᏝᎡᎢᎪᎢ
|
||||||
|
ᎠᎦᏂᏗᎮᎢᎫᎩᎬᏩᎴᎢᎠᏆᏅᏛᎫᏊᎾᎥᎠᏁᏙᎲᏐᏈᎵᎤᎩᎸᏓᏭᎷᏤᎢᏏᏉᏯᏌᏊ ᎤᏂᏋᎢᏡᎬᎢᎰᏩᎬᏤᎵᏍᏗᏱᎩᎱᎱᎤᎩᎴᎢᏦᎢᎠᏂᏧᏣᏨᎦᏥᎪᎥᏌᏊᎤᎶᏒᎢᎢᏡᎬᎢ
|
||||||
|
ᎹᎦᎺᎵᏥᎻᎼᏏᎽᏗᏩᏂᎦᏘᎾᎿᎠᏁᎬᎢᏅᎩᎾᏂᎡᎢᏌᎶᎵᏎᎷᎠᏑᏍᏗᏪᎩ ᎠᎴ ᏬᏗᏲᏭᎾᏓᏍᏓᏴᏁᎢᎤᎦᏅᏮᏰᎵᏳᏂᎨᎢ
|
||||||
|
Příliš žluťoučký kůň úpěl ďábelské ódy
|
||||||
|
Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen Walther spillede på xylofon
|
||||||
|
PACK MY BOX WITH FIVE DOZEN LIQUOR JUGS
|
||||||
|
Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich GROẞEN GROẞE
|
||||||
|
ζαφείρι δέξου πάγκαλο, βαθων ψυχης το σημα
|
||||||
|
ΔΙΑΦΥΛΆΞΤΕ ΓΕΝΙΚΆ ΤΗ ΖΩΉ ΣΑΣ ΑΠΌ ΒΑΘΕΙΆ ΨΥΧΙΚΆ ΤΡΑΎΜΑΤΑ
|
||||||
|
სწრაფი ყავისფერი მელა გადაახტა ზარმაც ძაღლს ᲘᲜᲢᲔᲚ ᲞᲔᲜᲢᲘᲣᲛᲘ ᲛᲘᲙᲠᲝᲞᲠᲝᲪᲔᲡᲝᲠᲘ
|
||||||
|
ऋषियों को सताने वाले दुष्ट राक्षसों के राजा रावण का सर्वनाश करने वाले विष्णुवतार भगवान श्रीराम अयोध्या के महाराज दशरथ के
|
||||||
|
Kæmi ný öxi hér, ykist þjófum nú bæði víl og ádrepa
|
||||||
|
Ꝺꝼuaꞅcail Íoꞅa Úꞃṁac na hÓiᵹe Beannaiꞇe póꞃ Éaḃa aᵹus Áꝺaiṁ
|
||||||
|
Ċuaiġ bé ṁórṡáċ le dlúṫspád fíorḟinn trí hata mo ḋea-ṗorcáin ḃig
|
||||||
|
あめつちほしそら やまかはみねたに くもきりむろこけ ひといぬうへすゑ ゆわさるおふせよ えの𛀁をなれゐて
|
||||||
|
トリナクコヱス ユメサマセ ミヨアケワタル ヒンカシヲ ソライロハエテ オキツヘニ ホフネムレヰヌ モヤノウチ
|
||||||
|
田居に出で 菜摘むわれをぞ 君召すと 求食り追ひゆく 山城の 打酔へる子ら 藻葉干せよ え舟繋けぬ
|
||||||
|
정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날 하얬다 도럄직한 퀡봹퉪헰
|
||||||
|
Četri psihi faķīri vēlu vakarā zāģēja guļbūvei durvis, fonā šņācot mežam
|
||||||
|
Įlinkdama fechtuotojo špaga sublykčiojusi pragręžė apvalų arbūzą
|
||||||
|
Ѕидарски пејзаж: шугав билмез со чудење џвака ќофте и кељ на туѓ цех
|
||||||
|
Щётканы фермд пийшин цувъя. Бөгж зогсч хэльюү
|
||||||
|
Pchnąć w tę łódź jeża lub ośm skrzyń fig
|
||||||
|
कः खगौघाङचिच्छौजा झाञ्ज्ञोऽटौठीडडण्ढणः। तथोदधीन् पफर्बाभीर्मयोऽरिल्वाशिषां सहः॥
|
||||||
|
Înjurând pițigăiat, zoofobul comandă vexat whisky și tequila
|
||||||
|
Широкая электрификация южных губерний даст мощный толчок подъёму сельского хозяйства
|
||||||
|
Ајшо, лепото и чежњо, за љубав срца мога дођи у Хаџиће на кафу
|
||||||
|
Jovencillo emponzoñado de whisky: ¡qué figurota exhibe!
|
||||||
|
นายสังฆภัณฑ์ เฮงพิทักษ์ฝั่ง ผู้เฒ่าซึ่งมีอาชีพเป็นฅนขายฃวด ถูกตำรวจปฏิบัติการจับฟ้องศาล ฐานลักนาฬิกาคุณหญิงฉัตรชฎา ฌานสมาธิ
|
||||||
|
Pijamalı hasta yağız şoföre çabucak güvendi
|
||||||
|
Жебракують філософи при ґанку церкви в Гадячі, ще й шатро їхнє п’яне знаємо
|
||||||
|
Do bạch kim rất quý nên sẽ dùng để lắp vô xương
|
||||||
|
日堀油告観観藤村抄海評業庁経賃室弁市。太撮収改売週法所何都慣次現。価紙一無三洋日話転手治稿載末替付致治。
|
||||||
|
|
||||||
|
Features:
|
||||||
|
|
||||||
|
Ever heard of « Guillemets »? You speak „Nederlands” or „Deutsch“? ”suomi”? 「日本語」しゃべる?或《中文》?
|
||||||
|
|
||||||
|
Multilingual brackets; these are the most basic things, right?
|
||||||
|
|
||||||
|
99406 91902 59186 29182 45814 57862 34368 08240
|
||||||
|
31485 65379 04348 28952 42927 26157 42615 39526
|
||||||
|
|
||||||
|
Fixed-width numbers, because number-crunching matters
|
||||||
|
|
||||||
|
ᚱᛂᚴᛋᛂᛋᛏᛋᚮᚾᛔᚢᛏᛚᚮᛋ᛬ᚱᛂᚴᛋᛋᚢᚼᚾᚢᛘᚢᛚᚾᛏᚮ᛬ᛏᚮᛋᛁᚮᚵᛂᚢᛏᚮᚱᛘᛔᚱᛂᚴᛋᛏ᛭ᛋᚢᚼᚾᚢᛋᛘᚮᛁᚵᚾᛁᛂᛏᚮᛑ᛭ᚵᛂᚢᛏᚮᚱ
|
||||||
|
|
||||||
|
Colour-code that supports 65535 opaque or semi-transparent colours via 4 bit ARGB
|
||||||
|
|
||||||
|
Гномът Доцьо приключи спящ в шейна за жаби (Bulgarian)
|
||||||
|
Љубазни фењерџија чађавог лица хоће да ми покаже штос (Serbian)
|
||||||
|
Разъяренный чтец эгоистично бьёт пятью жердями шустрого фехтовальщика (Russian)
|
||||||
|
|
||||||
|
Control characters to support Bulgarian and Serbian letter shapes on the fly
|
||||||
|
|
||||||
|
Press to pay respects—or is it , or …
|
||||||
|
|
||||||
|
Custom symbols for video games
|
||||||
|
|
||||||
|
Can you distinguish following dashes: - – — - – — – - ――――――――――― 48–63 48-63
|
||||||
|
|
||||||
|
For all those dash-pedants, we have en-dash, em-dash, and even horizontal bars!
|
||||||
|
|
||||||
|
Unicode References:
|
||||||
|
|
||||||
|
Basic Latin Latin-1 Latin Extension A Latin Extionsion B IPA Extension Greek Cyrillic
|
||||||
|
Cyrillic Supplement Armenian Devanagari Thai Georgian Runic Cherokee Georgian Extended
|
||||||
|
General Punctuations CJK Symbols Kana Kana Phonetic Extension CJK Unihan Extension A CJK Unihan
|
||||||
|
Hangul Syllables Fullwidth Forms Kana Supplement
|
||||||
|
|
||||||
|
GitHub’s issue page is open! You can report any errors, or leave suggestions.
|
||||||
|
You can help this font to be more versatile. (for more languages, more frameworks) Clone this repo, make
|
||||||
|
changes, and make a pull request! I appreciate any and all supports.
|
||||||
BIN
FontTestGDX/lib/TerrarumSansBitmap.jar
Normal file
265
FontTestGDX/src/FontTestGDX.kt
Normal file
@@ -0,0 +1,265 @@
|
|||||||
|
import com.badlogic.gdx.*
|
||||||
|
import com.badlogic.gdx.backends.lwjgl.LwjglApplication
|
||||||
|
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration
|
||||||
|
import com.badlogic.gdx.graphics.*
|
||||||
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||||
|
import com.badlogic.gdx.graphics.glutils.FrameBuffer
|
||||||
|
import com.badlogic.gdx.utils.ScreenUtils
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by minjaesong on 2018-07-26.
|
||||||
|
*/
|
||||||
|
class FontTestGDX : Game() {
|
||||||
|
|
||||||
|
lateinit var font: GameFontBase
|
||||||
|
|
||||||
|
lateinit var inputText: List<String>
|
||||||
|
|
||||||
|
lateinit var batch: SpriteBatch
|
||||||
|
|
||||||
|
lateinit var frameBuffer: FrameBuffer
|
||||||
|
|
||||||
|
lateinit var camera: OrthographicCamera
|
||||||
|
|
||||||
|
override fun create() {
|
||||||
|
font = GameFontBase("./assets", flipY = false, errorOnUnknownChar = true) // must test for two flipY cases
|
||||||
|
|
||||||
|
val inTextFile = Gdx.files.internal("./FontTestGDX/demotext.txt")
|
||||||
|
val reader = inTextFile.reader()
|
||||||
|
inputText = reader.readLines()
|
||||||
|
reader.close()
|
||||||
|
|
||||||
|
batch = SpriteBatch()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
println("START")
|
||||||
|
|
||||||
|
val l = intArrayOf(0xFF00,
|
||||||
|
0xFF10,
|
||||||
|
0xFF20,
|
||||||
|
0xFF30,
|
||||||
|
0xFF40,
|
||||||
|
0xFF50,
|
||||||
|
0xFF60,
|
||||||
|
0xFF70,
|
||||||
|
0xFF80,
|
||||||
|
0xFF90,
|
||||||
|
0xFFA0,
|
||||||
|
0xFFB0,
|
||||||
|
0xFFC0,
|
||||||
|
0xFFD0,
|
||||||
|
0xFFE0,
|
||||||
|
0xFFF0,
|
||||||
|
0xFEF0,
|
||||||
|
0xFDF0,
|
||||||
|
0xFCF0,
|
||||||
|
0xFBF0,
|
||||||
|
0xFAF0,
|
||||||
|
0xF9F0,
|
||||||
|
0xF8F0,
|
||||||
|
0xF7F0,
|
||||||
|
0xF6F0,
|
||||||
|
0xF5F0,
|
||||||
|
0xF4F0,
|
||||||
|
0xF3F0,
|
||||||
|
0xF2F0,
|
||||||
|
0xF1F0,
|
||||||
|
0xF0F0,
|
||||||
|
0xF0F1,
|
||||||
|
0xF0F2,
|
||||||
|
0xF0F3,
|
||||||
|
0xF0F4,
|
||||||
|
0xF0F5,
|
||||||
|
0xF0F6,
|
||||||
|
0xF0F7,
|
||||||
|
0xF0F8,
|
||||||
|
0xF0F9,
|
||||||
|
0xF0FA,
|
||||||
|
0xF0FB,
|
||||||
|
0xF0FC,
|
||||||
|
0xF0FD,
|
||||||
|
0xF0FE,
|
||||||
|
0xF0FF,
|
||||||
|
0xF0EF,
|
||||||
|
0xF0DF,
|
||||||
|
0xF0CF,
|
||||||
|
0xF0BF,
|
||||||
|
0xF0AF,
|
||||||
|
0xF09F,
|
||||||
|
0xF08F,
|
||||||
|
0xF07F,
|
||||||
|
0xF06F,
|
||||||
|
0xF05F,
|
||||||
|
0xF04F,
|
||||||
|
0xF03F,
|
||||||
|
0xF02F,
|
||||||
|
0xF01F,
|
||||||
|
0xF00F,
|
||||||
|
0xF10F,
|
||||||
|
0xF20F,
|
||||||
|
0xF30F,
|
||||||
|
0xF40F,
|
||||||
|
0xF50F,
|
||||||
|
0xF60F,
|
||||||
|
0xF70F,
|
||||||
|
0xF80F,
|
||||||
|
0xF90F,
|
||||||
|
0xFA0F,
|
||||||
|
0xFB0F,
|
||||||
|
0xFC0F,
|
||||||
|
0xFD0F,
|
||||||
|
0xFE0F,
|
||||||
|
0xFF0F)
|
||||||
|
val s = "ᚱᛂᚴᛋᛂᛋᛏᛋᚮᚾᛔᚢᛏᛚᚮᛋ᛬ᚱᛂᚴᛋᛋᚢᚼᚾᚢᛘᚢᛚᚾᛏᚮ᛬ᛏᚮᛋᛁᚮᚵᛂᚢᛏᚮᚱᛘᛔᚱᛂᚴᛋᛏ᛭ᛋᚢᚼᚾᚢᛋᛘᚮᛁᚵᚾᛁᛂᛏᚮᛑ᛭ᚵᛂᚢᛏᚮᚱ"
|
||||||
|
var lc = 0
|
||||||
|
var sc = 0
|
||||||
|
|
||||||
|
while (lc < l.size) {
|
||||||
|
print(font.toColorCode(l[lc]))
|
||||||
|
print(s[sc])
|
||||||
|
|
||||||
|
lc++
|
||||||
|
sc++
|
||||||
|
|
||||||
|
if (sc == s.length) break
|
||||||
|
|
||||||
|
if (s[sc] == ' ') {
|
||||||
|
print(" ")
|
||||||
|
sc++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println("${font.noColorCode}\nEND")
|
||||||
|
|
||||||
|
println(font.toColorCode(0xF_EEC))
|
||||||
|
|
||||||
|
frameBuffer = FrameBuffer(Pixmap.Format.RGBA8888, TEXW, TEXH, true)
|
||||||
|
|
||||||
|
camera = OrthographicCamera(TEXW.toFloat(), TEXH.toFloat())
|
||||||
|
camera.translate(TEXW.div(2f), 0f)
|
||||||
|
camera.setToOrtho(true, TEXW.toFloat(), TEXH.toFloat())
|
||||||
|
camera.update()
|
||||||
|
|
||||||
|
|
||||||
|
Gdx.input.inputProcessor = Navigator(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getScreen(): Screen? {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
var scrollOffsetY = 0f
|
||||||
|
|
||||||
|
override fun setScreen(screen: Screen?) {
|
||||||
|
}
|
||||||
|
|
||||||
|
var tex: Texture? = null
|
||||||
|
var screenshotExported = false
|
||||||
|
|
||||||
|
override fun render() {
|
||||||
|
|
||||||
|
if (tex == null) {
|
||||||
|
frameBuffer.begin()
|
||||||
|
|
||||||
|
Gdx.gl.glClearColor(.141f, .141f, .141f, 1f)
|
||||||
|
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
|
||||||
|
Gdx.gl.glEnable(GL20.GL_TEXTURE_2D)
|
||||||
|
Gdx.gl.glEnable(GL20.GL_BLEND)
|
||||||
|
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA)
|
||||||
|
|
||||||
|
batch.projectionMatrix = camera.combined
|
||||||
|
batch.begin()
|
||||||
|
|
||||||
|
batch.color = Color(0xeeeeeeff.toInt())
|
||||||
|
inputText.forEachIndexed { index, s ->
|
||||||
|
font.draw(batch, s, 10f, TEXH - 30f - index * font.lineHeight)
|
||||||
|
}
|
||||||
|
|
||||||
|
batch.end()
|
||||||
|
|
||||||
|
|
||||||
|
// dump to file
|
||||||
|
if (!screenshotExported) {
|
||||||
|
val pixmap = ScreenUtils.getFrameBufferPixmap(0, 0, frameBuffer.width, frameBuffer.height)
|
||||||
|
|
||||||
|
PixmapIO.writePNG(Gdx.files.local("demo.PNG"), pixmap)
|
||||||
|
pixmap.dispose()
|
||||||
|
|
||||||
|
screenshotExported = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
frameBuffer.end()
|
||||||
|
|
||||||
|
///////////////
|
||||||
|
|
||||||
|
tex = frameBuffer.colorBufferTexture
|
||||||
|
}
|
||||||
|
|
||||||
|
batch.begin()
|
||||||
|
batch.color = Color.WHITE
|
||||||
|
batch.draw(tex, 0f, (TEXH.toFloat()/appConfig.height)*TEXH - scrollOffsetY, TEXW.toFloat(), -(TEXH.toFloat() / appConfig.height) * TEXH.toFloat())
|
||||||
|
|
||||||
|
|
||||||
|
batch.end()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun pause() {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun resume() {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun resize(width: Int, height: Int) {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun dispose() {
|
||||||
|
font.dispose()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun scrollAdd(x: Int = 1) {
|
||||||
|
scrollOffsetY -= (TEXH.toFloat() / appConfig.height) * 20f * x
|
||||||
|
}
|
||||||
|
|
||||||
|
fun scrollSub(x: Int = 1) {
|
||||||
|
scrollOffsetY += (TEXH.toFloat() / appConfig.height) * 20f * x
|
||||||
|
}
|
||||||
|
|
||||||
|
class Navigator(val main: FontTestGDX) : InputAdapter() {
|
||||||
|
override fun scrolled(amount: Int): Boolean {
|
||||||
|
if (amount >= 0)
|
||||||
|
main.scrollSub(amount)
|
||||||
|
else
|
||||||
|
main.scrollAdd(-amount)
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun keyDown(keycode: Int): Boolean {
|
||||||
|
if (keycode == Input.Keys.UP)
|
||||||
|
main.scrollAdd()
|
||||||
|
else if (keycode == Input.Keys.DOWN)
|
||||||
|
main.scrollSub()
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lateinit var appConfig: LwjglApplicationConfiguration
|
||||||
|
const val TEXW = 874
|
||||||
|
const val TEXH = 2060
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
appConfig = LwjglApplicationConfiguration()
|
||||||
|
appConfig.vSyncEnabled = false
|
||||||
|
appConfig.resizable = false//true;
|
||||||
|
appConfig.width = TEXW
|
||||||
|
appConfig.height = 768
|
||||||
|
appConfig.title = "Terrarum Sans Bitmap Test (GDX)"
|
||||||
|
|
||||||
|
LwjglApplication(FontTestGDX(), appConfig)
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
Terrarum Sans Bitmap
|
Terrarum Sans Bitmap
|
||||||
|
|
||||||
Copyright (c) 2017 Minjae Song (Torvald) and the contributors
|
Copyright (c) 2017-2018 Minjae Song (Torvald) and the contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -19,6 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
WenQuanYi font is distributed under GNU GPL Version 2. See their [license document here](http://wenq.org/wqy2/index.cgi?GPL)
|
|
||||||
|
|||||||
2
META-INF/MANIFEST.MF
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
|
||||||
BIN
PUA_allocation_chart.xlsx
Normal file
174
README.md
@@ -1,33 +1,83 @@
|
|||||||
# Terrarum Sans Bitmap
|
# Terrarum Sans Bitmap
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|
This font is a bitmap font used in [my game project called Terrarum](https://gitlab.com/minjaesong/terrarum) (hence the name). The font supports more than 90 % of european languages, as well as Chinese, Japanese and Korean. More technical side, it supports Latin-1 Supplement, Latin Ext-A, Latin Ext-B, IPA Extension (required by some languages), Greek, Cyrillic (+ Bulgarian, Serbian variants) and the supplement, Armenian, Thai (beta version), Georgian, Unicode Punctuations, CJK Punctuations, Kana, Chinese (limited to Unihan and Ext-A), Hangul (all 11 172 possible syllables) and Fullwidth forms.
|
||||||
|
|
||||||
This font is a bitmap font used in my game project, Terrarum (hence the name). It Supports ExtA, Romanian (subset of ExtB), Cyrillic (Russian, Bulgarian, Serbian), Greek, Chinese, Japanese and Korean.
|
The JAR package is meant to be used with Slick2d (extends ```Font``` class) and LibGDX (extends ```BitmapFont``` class). If you are not using the framework, please refer to the __Font metrics__ section to implement the font metrics correctly on your system.
|
||||||
|
|
||||||
The code for the fonts are meant to be used with Slick2d (extends ```Font``` class). If you are not using the framework, please refer to the __Font metrics__ section to implement the font metrics correctly on your system.
|
|
||||||
|
|
||||||
The issue page is open. If you have some issues to submit, or have a question, please leave it on the page.
|
The issue page is open. If you have some issues to submit, or have a question, please leave it on the page.
|
||||||
|
|
||||||
|
#### Little notes
|
||||||
|
- To display Bulgarian/Serbian variants, you need special Control Characters. (GameFontBase.charsetOverrideBulgarian -- U+FFFF9; GameFontBase.charsetOverrideSerbian -- U+FFFFA)
|
||||||
|
- All Han characters are in Chinese variant, no other variants are to be supported as most Chinese, Japanese and Korean can understand other's variant and to be honest, we don't bother anyway.
|
||||||
|
- Indian script in general is not perfect: this font will never do the proper ligatures (I can't draw all the 1 224 possible combinations). Hopefully it's still be able to understand without them.
|
||||||
|
|
||||||
## Contribution guidelines
|
### Design Goals
|
||||||
|
|
||||||
You can contribute to the font by fixing wrong glyphs, suggesting better ones, extending character set (like Latin Extended B), or code for other game frameworks such as LibGDX. Please leave pull request for that.
|
- Sans-serif
|
||||||
|
- Realise (some of) handwritten forms
|
||||||
Font images are stored in ```assets/graphics/fonts``` directory. Image format must be TGA with Alpha — no PNG. If someone needs PNG, they can batch-convert the font using utils like ImageMagick.
|
- Combininig with the sans-serif, this stands for **no over-simplification**
|
||||||
|
- Condensed capitals for efficient space usage
|
||||||
|
|
||||||
|
|
||||||
## Using on Slick2d
|
## Using on your game
|
||||||
|
|
||||||
|
- Firstly, place the .jar to your library path and assets folder to the main directory of the app, then:
|
||||||
|
|
||||||
|
### Using on LibGDX
|
||||||
|
|
||||||
On your code (Kotlin):
|
On your code (Kotlin):
|
||||||
|
|
||||||
class YourGame {
|
class YourGame : Game() {
|
||||||
|
|
||||||
lateinit var fontGame: Font
|
lateinit var fontGame: Font
|
||||||
|
|
||||||
override fun initStatesList(gc: GameContainer) {
|
override fun create() {
|
||||||
fontGame = GameFontImpl()
|
fontGame = GameFontBase(path_to_assets)
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun render() {
|
||||||
|
batch.begin()
|
||||||
|
...
|
||||||
|
fontGame.draw(batch, text, ...)
|
||||||
|
...
|
||||||
|
batch.end()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
On your code (Java):
|
||||||
|
|
||||||
|
class YourGame extends BasicGame {
|
||||||
|
|
||||||
|
Font fontGame;
|
||||||
|
|
||||||
|
@Override void create() {
|
||||||
|
fontGame = new GameFontBase(path_to_assets);
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override void render() {
|
||||||
|
batch.begin();
|
||||||
|
...
|
||||||
|
fontGame.draw(batch, text, ...);
|
||||||
|
...
|
||||||
|
batch.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
### Using on Slick2d
|
||||||
|
|
||||||
|
On your code (Kotlin):
|
||||||
|
|
||||||
|
class YourGame : BasicGame("YourGameName") {
|
||||||
|
|
||||||
|
lateinit var fontGame: Font
|
||||||
|
|
||||||
|
override fun init(gc: GameContainer) {
|
||||||
|
fontGame = GameFontBase(path_to_assets)
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,107 +89,41 @@ On your code (Kotlin):
|
|||||||
|
|
||||||
On your code (Java):
|
On your code (Java):
|
||||||
|
|
||||||
class YourGame {
|
class YourGame extends BasicGame {
|
||||||
|
|
||||||
Font fontGame;
|
Font fontGame;
|
||||||
|
|
||||||
void initStatesList(GameContainer gc) {
|
@Override void init(GameContainer gc) {
|
||||||
fontGame = new GameFontImpl();
|
fontGame = new GameFontBase(path_to_assets);
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
void render(GameContainer gc, Graphics g) {
|
@Override void render(GameContainer gc, Graphics g) {
|
||||||
g.setFont(fontGame);
|
g.setFont(fontGame);
|
||||||
g.drawString(...);
|
g.drawString(...);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
## Font metrics
|
### How to Use Color Code
|
||||||
|
|
||||||
The font expects both variable widths and fixed width to be supported. Any images with ```_variable``` means it expects variable widths. Anything else expects fixed width. ```romana_narrow``` has width of 6 (no, not 5), ```romana_wide``` has width of 9, ```cjkpunct``` has width of 10, ```kana``` has width of 12, ```hangul_johab``` has width of 11, ```wenquanyi``` has width of 16.
|
Color codes are individual unicode characters. While you can somehow make a raw character and paste in on your code, it's certainly not desirable. Fortunately, we're also providing utility functions for the color codes.
|
||||||
|
|
||||||
### Parsing glyph widths for variable font sheets
|
GameFontBase.toColorCode(argb4444: Int) -- returns String
|
||||||
|
GameFontBase.toColorCode(r: Int, g: Int, b: Int) -- returns String
|
||||||
|
GameFontBase.toColorCode(r: Int, g: Int, b: Int, a: Int) -- returns String
|
||||||
|
|
||||||
Width is encoded in binary number, on pixels. On the font image, every glyph has vertical dots on their right side (to be exact, every (16k - 1)th pixel on x axis). From top to bottom, each dot represents 1, 2, 4 and 8. For example, ASCII glyph 'C' has width of 9, 'W' has width of 11, " (double quote) has width of 6.
|
```argb4444``` takes whole ARGB (in that order) as input, that is, from 0x0000 to 0xFFFF.
|
||||||
|
```r, g, b(, a)``` takes RGB and A separately, in the range of 0x0..0xF. Any value exceeding the range **are unchecked and may wreak havoc**, so be careful.
|
||||||
|
|
||||||
### Implementing the Korean writing system
|
U+100000 is used to disable previously-applied color codes (going back to original colour), even if it looks like ARGB of all zero.
|
||||||
|
|
||||||
On this font, Hangul letters are printed by assemblying two or three letter pieces. There are 10 sets of Hangul letter pieces on the font. Top 6 are initials, middle 2 are medials, and bottom 2 are finals. On the rightmost side, there's eight assembled glyphs to help you with (assuming you have basic knowledge on the writing system). Top 6 tells you how to use 6 initials, and bottom 2 tells you how to use 2 finals.
|
|
||||||
|
|
||||||
This is a Kotlin-like pseudocode for assembling the glyph:
|
## Contribution guidelines
|
||||||
|
|
||||||
jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
|
Please refer to [CONTRIBUTING.md](https://github.com/minjaesong/Terrarum-sans-bitmap/blob/master/CONTRIBUTING.md)
|
||||||
jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
|
|
||||||
|
|
||||||
function getHanInitialRow(hanIndex: Int): Int {
|
|
||||||
val ret: Int
|
|
||||||
|
|
||||||
if (isJungseongWide(hanIndex))
|
|
||||||
ret = 2
|
|
||||||
else if (isJungseongComplex(hanIndex))
|
|
||||||
ret = 4
|
|
||||||
else
|
|
||||||
ret = 0
|
|
||||||
|
|
||||||
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
function isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
|
|
||||||
function isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
|
|
||||||
|
|
||||||
function getHanInitialRow(hanIndex: Int): Int {
|
|
||||||
val ret: Int
|
|
||||||
|
|
||||||
if (isJungseongWide(hanIndex))
|
|
||||||
ret = 2
|
|
||||||
else if (isJungseongComplex(hanIndex))
|
|
||||||
ret = 4
|
|
||||||
else
|
|
||||||
ret = 0
|
|
||||||
|
|
||||||
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
function getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
|
|
||||||
|
|
||||||
function getHanFinalRow(hanIndex: Int): Int {
|
|
||||||
val jungseongIndex = getHanJungseong(hanIndex)
|
|
||||||
|
|
||||||
return if (jungseongWide.contains(jungseongIndex))
|
|
||||||
8
|
|
||||||
else
|
|
||||||
9
|
|
||||||
}
|
|
||||||
|
|
||||||
function isHangul(c: Char) = c.toInt() >= 0xAC00 && c.toInt() < 0xD7A4
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
for (each Char on the string) {
|
|
||||||
if (isHangul(Char)) {
|
|
||||||
val hIndex = Char.toInt() - 0xAC00
|
|
||||||
|
|
||||||
val indexCho = getHanChosung(hIndex)
|
|
||||||
val indexJung = getHanJungseong(hIndex)
|
|
||||||
val indexJong = getHanJongseong(hIndex)
|
|
||||||
|
|
||||||
val choRow = getHanInitialRow(hIndex)
|
|
||||||
val jungRow = getHanMedialRow(hIndex)
|
|
||||||
val jongRow = getHanFinalRow(hIndex)
|
|
||||||
|
|
||||||
// get sub image from sprite sheet
|
|
||||||
val choseongImage = hangulSheet.getSubImage(indexCho, choRow)
|
|
||||||
val jungseongImage = hangulSheet.getSubImage(indexJung, jungRow)
|
|
||||||
val jongseongImage = hangulSheet.getSubImage(indexJong, jongRow)
|
|
||||||
|
|
||||||
// actual drawing part
|
|
||||||
draw choseongImage to somewhere you want
|
|
||||||
draw jungseongImage on top of choseongImage
|
|
||||||
draw jongseongImage on top of choseongImage
|
|
||||||
}
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
## Acknowledgement
|
## Acknowledgement
|
||||||
|
|
||||||
Thanks to kind people of [/r/Typography](https://www.reddit.com/r/typography/) for amazing feedbacks.
|
Thanks to kind people of [/r/Typography](https://www.reddit.com/r/typography/) for amazing feedbacks.
|
||||||
|
|
||||||
|
CJK Ideographs are powered by [WenQuanYi Font](http://wenq.org/wqy2/index.cgi?BitmapSong). The font is distributed under the GNU GPL version 2. Although, in some countries including where I'm based on, the shapes of typefaces are not copyrightable (the program codes—e.g. TTF—do), we would like to give a credit for the font and the people behind it.
|
||||||
|
|||||||
@@ -1,552 +0,0 @@
|
|||||||
package net.torvald.imagefont
|
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11
|
|
||||||
import org.newdawn.slick.*
|
|
||||||
import org.newdawn.slick.opengl.Texture
|
|
||||||
import java.nio.ByteOrder
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by minjaesong on 16-01-27.
|
|
||||||
*/
|
|
||||||
open class GameFontBase : Font {
|
|
||||||
|
|
||||||
private fun getHan(hanIndex: Int): IntArray {
|
|
||||||
val han_x = hanIndex % JONG_COUNT
|
|
||||||
val han_y = hanIndex / JONG_COUNT
|
|
||||||
val ret = intArrayOf(han_x, han_y)
|
|
||||||
return ret
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getHanChosung(hanIndex: Int) = hanIndex / (JUNG_COUNT * JONG_COUNT)
|
|
||||||
|
|
||||||
private fun getHanJungseong(hanIndex: Int) = hanIndex / JONG_COUNT % JUNG_COUNT
|
|
||||||
|
|
||||||
private fun getHanJongseong(hanIndex: Int) = hanIndex % JONG_COUNT
|
|
||||||
|
|
||||||
private val jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
|
|
||||||
private val jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
|
|
||||||
|
|
||||||
private fun isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
|
|
||||||
private fun isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
|
|
||||||
|
|
||||||
private fun getHanInitialRow(hanIndex: Int): Int {
|
|
||||||
val ret: Int
|
|
||||||
|
|
||||||
if (isJungseongWide(hanIndex))
|
|
||||||
ret = 2
|
|
||||||
else if (isJungseongComplex(hanIndex))
|
|
||||||
ret = 4
|
|
||||||
else
|
|
||||||
ret = 0
|
|
||||||
|
|
||||||
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
|
|
||||||
|
|
||||||
private fun getHanFinalRow(hanIndex: Int): Int {
|
|
||||||
val jungseongIndex = getHanJungseong(hanIndex)
|
|
||||||
|
|
||||||
return if (jungseongWide.contains(jungseongIndex))
|
|
||||||
8
|
|
||||||
else
|
|
||||||
9
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun isHangul(c: Char) = c.toInt() >= 0xAC00 && c.toInt() < 0xD7A4
|
|
||||||
private fun isAscii(c: Char) = c.toInt() >= 0x20 && c.toInt() <= 0xFF
|
|
||||||
private fun isExtA(c: Char) = c.toInt() >= 0x100 && c.toInt() < 0x180
|
|
||||||
private fun isKana(c: Char) = c.toInt() >= 0x3040 && c.toInt() < 0x3100
|
|
||||||
private fun isCJKPunct(c: Char) = c.toInt() >= 0x3000 && c.toInt() < 0x3040
|
|
||||||
private fun isUniHan(c: Char) = c.toInt() >= 0x3400 && c.toInt() < 0xA000
|
|
||||||
private fun isCyrilic(c: Char) = c.toInt() >= 0x400 && c.toInt() < 0x460
|
|
||||||
private fun isFullwidthUni(c: Char) = c.toInt() >= 0xFF00 && c.toInt() < 0xFF20
|
|
||||||
private fun isUniPunct(c: Char) = c.toInt() >= 0x2000 && c.toInt() < 0x2070
|
|
||||||
private fun isWenQuanYi1(c: Char) = c.toInt() >= 0x33F3 && c.toInt() <= 0x69FC
|
|
||||||
private fun isWenQuanYi2(c: Char) = c.toInt() >= 0x69FD && c.toInt() <= 0x9FDC
|
|
||||||
private fun isGreek(c: Char) = c.toInt() >= 0x370 && c.toInt() <= 0x3CE
|
|
||||||
private fun isRomanian(c: Char) = c.toInt() >= 0x218 && c.toInt() <= 0x21A
|
|
||||||
private fun isRomanianNarrow(c: Char) = c.toInt() == 0x21B
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private fun extAindexX(c: Char) = (c.toInt() - 0x100) % 16
|
|
||||||
private fun extAindexY(c: Char) = (c.toInt() - 0x100) / 16
|
|
||||||
|
|
||||||
private fun kanaIndexX(c: Char) = (c.toInt() - 0x3040) % 16
|
|
||||||
private fun kanaIndexY(c: Char) = (c.toInt() - 0x3040) / 16
|
|
||||||
|
|
||||||
private fun cjkPunctIndexX(c: Char) = (c.toInt() - 0x3000) % 16
|
|
||||||
private fun cjkPunctIndexY(c: Char) = (c.toInt() - 0x3000) / 16
|
|
||||||
|
|
||||||
private fun uniHanIndexX(c: Char) = (c.toInt() - 0x3400) % 256
|
|
||||||
private fun uniHanIndexY(c: Char) = (c.toInt() - 0x3400) / 256
|
|
||||||
|
|
||||||
private fun cyrilicIndexX(c: Char) = (c.toInt() - 0x400) % 16
|
|
||||||
private fun cyrilicIndexY(c: Char) = (c.toInt() - 0x400) / 16
|
|
||||||
|
|
||||||
private fun fullwidthUniIndexX(c: Char) = (c.toInt() - 0xFF00) % 16
|
|
||||||
private fun fullwidthUniIndexY(c: Char) = (c.toInt() - 0xFF00) / 16
|
|
||||||
|
|
||||||
private fun uniPunctIndexX(c: Char) = (c.toInt() - 0x2000) % 16
|
|
||||||
private fun uniPunctIndexY(c: Char) = (c.toInt() - 0x2000) / 16
|
|
||||||
|
|
||||||
private fun wenQuanYiIndexX(c: Char) =
|
|
||||||
(c.toInt() - if (c.toInt() <= 0x4DB5) 0x33F3 else 0x33F3 + 0x4A) % 32
|
|
||||||
private fun wenQuanYi1IndexY(c: Char) = (c.toInt() - (0x33F3 + 0x4A)) / 32
|
|
||||||
private fun wenQuanYi2IndexY(c: Char) = (c.toInt() - 0x69FD) / 32
|
|
||||||
|
|
||||||
private fun greekIndexX(c: Char) = (c.toInt() - 0x370) % 16
|
|
||||||
private fun greekIndexY(c: Char) = (c.toInt() - 0x370) / 16
|
|
||||||
|
|
||||||
private fun romanianIndexX(c: Char) = c.toInt() - 0x218
|
|
||||||
private fun romanianIndexY(c: Char) = 0
|
|
||||||
|
|
||||||
private fun thaiIndexX(c: Char) = (c.toInt() - 0xE00) % 16
|
|
||||||
private fun thaiIndexY(c: Char) = (c.toInt() - 0xE00) / 16
|
|
||||||
|
|
||||||
private fun thaiNarrowIndexX(c: Char) = 3
|
|
||||||
private fun thaiNarrowIndexY(c: Char) = 0
|
|
||||||
|
|
||||||
|
|
||||||
private val narrowWidthSheets = arrayOf(
|
|
||||||
SHEET_EXTB_ROMANIAN_NARROW
|
|
||||||
)
|
|
||||||
private val unihanWidthSheets = arrayOf(
|
|
||||||
SHEET_UNIHAN,
|
|
||||||
SHEET_FW_UNI,
|
|
||||||
SHEET_WENQUANYI_1,
|
|
||||||
SHEET_WENQUANYI_2
|
|
||||||
)
|
|
||||||
private val zeroWidthSheets = arrayOf(
|
|
||||||
SHEET_COLOURCODE
|
|
||||||
)
|
|
||||||
private val variableWidthSheets = arrayOf(
|
|
||||||
SHEET_ASCII_VARW,
|
|
||||||
SHEET_CYRILIC_VARW,
|
|
||||||
SHEET_EXTA_VARW,
|
|
||||||
SHEET_GREEK_VARW
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
override fun getWidth(s: String) = getWidthSubstr(s, s.length)
|
|
||||||
|
|
||||||
private fun getWidthSubstr(s: String, endIndex: Int): Int {
|
|
||||||
var len = 0
|
|
||||||
for (i in 0..endIndex - 1) {
|
|
||||||
val chr = s[i]
|
|
||||||
val ctype = getSheetType(s[i])
|
|
||||||
|
|
||||||
if (chr.toInt() == 0x21B) // Romanian t; HAX!
|
|
||||||
len += 6
|
|
||||||
else if (variableWidthSheets.contains(ctype)) {
|
|
||||||
try {
|
|
||||||
len += asciiWidths[chr.toInt()]!!
|
|
||||||
}
|
|
||||||
catch (e: kotlin.KotlinNullPointerException) {
|
|
||||||
println("KotlinNullPointerException on glyph number ${Integer.toHexString(chr.toInt()).toUpperCase()}")
|
|
||||||
System.exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (zeroWidthSheets.contains(ctype))
|
|
||||||
len += 0
|
|
||||||
else if (narrowWidthSheets.contains(ctype))
|
|
||||||
len += W_LATIN_NARROW
|
|
||||||
else if (ctype == SHEET_CJK_PUNCT)
|
|
||||||
len += W_ASIAN_PUNCT
|
|
||||||
else if (ctype == SHEET_HANGUL)
|
|
||||||
len += W_HANGUL
|
|
||||||
else if (ctype == SHEET_KANA)
|
|
||||||
len += W_KANA
|
|
||||||
else if (unihanWidthSheets.contains(ctype))
|
|
||||||
len += W_UNIHAN
|
|
||||||
else
|
|
||||||
len += W_LATIN_WIDE
|
|
||||||
|
|
||||||
if (i < endIndex - 1) len += interchar
|
|
||||||
}
|
|
||||||
return len * scale
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getHeight(s: String) = H * scale
|
|
||||||
|
|
||||||
override fun getLineHeight() = H * scale
|
|
||||||
|
|
||||||
override fun drawString(x: Float, y: Float, s: String) = drawString(x, y, s, Color.white)
|
|
||||||
|
|
||||||
override fun drawString(x: Float, y: Float, s: String, color: Color) {
|
|
||||||
GL11.glEnable(GL11.GL_BLEND)
|
|
||||||
GL11.glColorMask(true, true, true, true)
|
|
||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA)
|
|
||||||
|
|
||||||
var thisCol = color
|
|
||||||
|
|
||||||
// hangul fonts first
|
|
||||||
//hangulSheet.startUse() // disabling texture binding to make the font coloured
|
|
||||||
// JOHAB
|
|
||||||
for (i in 0..s.length - 1) {
|
|
||||||
val ch = s[i]
|
|
||||||
|
|
||||||
if (isHangul(ch)) {
|
|
||||||
val hIndex = ch.toInt() - 0xAC00
|
|
||||||
|
|
||||||
val indexCho = getHanChosung(hIndex)
|
|
||||||
val indexJung = getHanJungseong(hIndex)
|
|
||||||
val indexJong = getHanJongseong(hIndex)
|
|
||||||
|
|
||||||
val choRow = getHanInitialRow(hIndex)
|
|
||||||
val jungRow = getHanMedialRow(hIndex)
|
|
||||||
val jongRow = getHanFinalRow(hIndex)
|
|
||||||
|
|
||||||
val glyphW = getWidth(ch.toString())
|
|
||||||
|
|
||||||
hangulSheet.getSubImage(indexCho, choRow).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
hangulSheet.getSubImage(indexJung, jungRow).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
hangulSheet.getSubImage(indexJong, jongRow).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//hangulSheet.endUse()
|
|
||||||
|
|
||||||
// unihan fonts
|
|
||||||
/*uniHan.startUse();
|
|
||||||
for (int i = 0; i < s.length(); i++) {
|
|
||||||
char ch = s.charAt(i);
|
|
||||||
|
|
||||||
if (isUniHan(ch)) {
|
|
||||||
int glyphW = getWidth("" + ch);
|
|
||||||
uniHan.renderInUse(
|
|
||||||
Math.round(x
|
|
||||||
+ getWidthSubstr(s, i + 1) - glyphW
|
|
||||||
)
|
|
||||||
, Math.round((H - H_UNIHAN) / 2 + y)
|
|
||||||
, uniHanIndexX(ch)
|
|
||||||
, uniHanIndexY(ch)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uniHan.endUse();*/
|
|
||||||
|
|
||||||
// WenQuanYi 1
|
|
||||||
//wenQuanYi_1.startUse()
|
|
||||||
|
|
||||||
for (i in 0..s.length - 1) {
|
|
||||||
val ch = s[i]
|
|
||||||
|
|
||||||
if (isWenQuanYi1(ch)) {
|
|
||||||
val glyphW = getWidth("" + ch)
|
|
||||||
wenQuanYi_1.getSubImage(wenQuanYiIndexX(ch), wenQuanYi1IndexY(ch)).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
Math.round((H - H_UNIHAN) / 2 + y).toFloat(),
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//wenQuanYi_1.endUse()
|
|
||||||
// WenQuanYi 2
|
|
||||||
//wenQuanYi_2.startUse()
|
|
||||||
|
|
||||||
for (i in 0..s.length - 1) {
|
|
||||||
val ch = s[i]
|
|
||||||
|
|
||||||
if (isWenQuanYi2(ch)) {
|
|
||||||
val glyphW = getWidth("" + ch)
|
|
||||||
wenQuanYi_2.getSubImage(wenQuanYiIndexX(ch), wenQuanYi2IndexY(ch)).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
Math.round((H - H_UNIHAN) / 2 + y).toFloat(),
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//wenQuanYi_2.endUse()
|
|
||||||
|
|
||||||
// regular fonts
|
|
||||||
var prevInstance = -1
|
|
||||||
for (i in 0..s.length - 1) {
|
|
||||||
val ch = s[i]
|
|
||||||
|
|
||||||
if (!isHangul(ch) && !isUniHan(ch)) {
|
|
||||||
|
|
||||||
// if not init, endUse first
|
|
||||||
if (prevInstance != -1) {
|
|
||||||
//sheetKey[prevInstance].endUse()
|
|
||||||
}
|
|
||||||
//sheetKey[getSheetType(ch)].startUse()
|
|
||||||
prevInstance = getSheetType(ch)
|
|
||||||
|
|
||||||
val sheetX: Int
|
|
||||||
val sheetY: Int
|
|
||||||
when (prevInstance) {
|
|
||||||
SHEET_EXTA_VARW -> {
|
|
||||||
sheetX = extAindexX(ch)
|
|
||||||
sheetY = extAindexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_KANA -> {
|
|
||||||
sheetX = kanaIndexX(ch)
|
|
||||||
sheetY = kanaIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_CJK_PUNCT -> {
|
|
||||||
sheetX = cjkPunctIndexX(ch)
|
|
||||||
sheetY = cjkPunctIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_CYRILIC_VARW -> {
|
|
||||||
sheetX = cyrilicIndexX(ch)
|
|
||||||
sheetY = cyrilicIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_FW_UNI -> {
|
|
||||||
sheetX = fullwidthUniIndexX(ch)
|
|
||||||
sheetY = fullwidthUniIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_UNI_PUNCT -> {
|
|
||||||
sheetX = uniPunctIndexX(ch)
|
|
||||||
sheetY = uniPunctIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_GREEK_VARW -> {
|
|
||||||
sheetX = greekIndexX(ch)
|
|
||||||
sheetY = greekIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_EXTB_ROMANIAN_WIDE -> {
|
|
||||||
sheetX = romanianIndexX(ch)
|
|
||||||
sheetY = romanianIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_EXTB_ROMANIAN_NARROW -> {
|
|
||||||
sheetX = 0
|
|
||||||
sheetY = 0
|
|
||||||
}
|
|
||||||
else -> {
|
|
||||||
sheetX = ch.toInt() % 16
|
|
||||||
sheetY = ch.toInt() / 16
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val glyphW = getWidth("" + ch)
|
|
||||||
try {
|
|
||||||
sheetKey[prevInstance]!!.getSubImage(sheetX, sheetY).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
|
|
||||||
// to deal with the height difference of the sheets
|
|
||||||
Math.round(y).toFloat() + (if (prevInstance == SHEET_CJK_PUNCT) -1 // height hack
|
|
||||||
else if (prevInstance == SHEET_FW_UNI) (H - H_HANGUL) / 2 // completely legit height adjustment
|
|
||||||
else 0).toFloat(),
|
|
||||||
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
}
|
|
||||||
catch (e: ArrayIndexOutOfBoundsException) {
|
|
||||||
// character that does not exist in the sheet. No render, pass.
|
|
||||||
}
|
|
||||||
catch (e1: RuntimeException) {
|
|
||||||
// System.err.println("[GameFontBase] RuntimeException raised while processing character '$ch' (U+${Integer.toHexString(ch.toInt()).toUpperCase()})")
|
|
||||||
// e1.printStackTrack()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (prevInstance != -1) {
|
|
||||||
//sheetKey[prevInstance].endUse()
|
|
||||||
}
|
|
||||||
|
|
||||||
GL11.glEnd()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getSheetType(c: Char): Int {
|
|
||||||
// EFs
|
|
||||||
if (isRomanianNarrow(c))
|
|
||||||
return SHEET_EXTB_ROMANIAN_NARROW
|
|
||||||
else if (isHangul(c))
|
|
||||||
return SHEET_HANGUL
|
|
||||||
else if (isKana(c))
|
|
||||||
return SHEET_KANA
|
|
||||||
else if (isUniHan(c))
|
|
||||||
return SHEET_UNIHAN
|
|
||||||
else if (isAscii(c))
|
|
||||||
return SHEET_ASCII_VARW
|
|
||||||
else if (isExtA(c))
|
|
||||||
return SHEET_EXTA_VARW
|
|
||||||
else if (isCyrilic(c))
|
|
||||||
return SHEET_CYRILIC_VARW
|
|
||||||
else if (isUniPunct(c))
|
|
||||||
return SHEET_UNI_PUNCT
|
|
||||||
else if (isCJKPunct(c))
|
|
||||||
return SHEET_CJK_PUNCT
|
|
||||||
else if (isFullwidthUni(c))
|
|
||||||
return SHEET_FW_UNI
|
|
||||||
else if (isGreek(c))
|
|
||||||
return SHEET_GREEK_VARW
|
|
||||||
else if (isRomanian(c))
|
|
||||||
return SHEET_EXTB_ROMANIAN_WIDE
|
|
||||||
else
|
|
||||||
return SHEET_UNKNOWN// fixed width punctuations
|
|
||||||
// fixed width
|
|
||||||
// fallback
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Draw part of a string to the screen. Note that this will still position the text as though
|
|
||||||
* it's part of the bigger string.
|
|
||||||
* @param x
|
|
||||||
* *
|
|
||||||
* @param y
|
|
||||||
* *
|
|
||||||
* @param s
|
|
||||||
* *
|
|
||||||
* @param color
|
|
||||||
* *
|
|
||||||
* @param startIndex
|
|
||||||
* *
|
|
||||||
* @param endIndex
|
|
||||||
*/
|
|
||||||
override fun drawString(x: Float, y: Float, s: String, color: Color, startIndex: Int, endIndex: Int) {
|
|
||||||
val unprintedHead = s.substring(0, startIndex)
|
|
||||||
val printedBody = s.substring(startIndex, endIndex)
|
|
||||||
val xoff = getWidth(unprintedHead)
|
|
||||||
drawString(x + xoff, y, printedBody, color)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun buildWidthTable(sheet: SpriteSheet, codeOffset: Int, codeRange: IntRange, rows: Int = 16) {
|
|
||||||
fun Byte.toUint() = java.lang.Byte.toUnsignedInt(this)
|
|
||||||
|
|
||||||
/** @return Intarray(R, G, B, A) */
|
|
||||||
fun Texture.getPixel(x: Int, y: Int): IntArray {
|
|
||||||
val textureWidth = this.textureWidth
|
|
||||||
val hasAlpha = this.hasAlpha()
|
|
||||||
|
|
||||||
val offset = (if (hasAlpha) 4 else 3) * (textureWidth * y + x) // 4: # of channels (RGBA)
|
|
||||||
|
|
||||||
if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) {
|
|
||||||
return intArrayOf(
|
|
||||||
this.textureData[offset].toUint(),
|
|
||||||
this.textureData[offset + 1].toUint(),
|
|
||||||
this.textureData[offset + 2].toUint(),
|
|
||||||
if (hasAlpha)
|
|
||||||
this.textureData[offset + 3].toUint()
|
|
||||||
else 255
|
|
||||||
)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return intArrayOf(
|
|
||||||
this.textureData[offset + 2].toUint(),
|
|
||||||
this.textureData[offset + 1].toUint(),
|
|
||||||
this.textureData[offset].toUint(),
|
|
||||||
if (hasAlpha)
|
|
||||||
this.textureData[offset + 3].toUint()
|
|
||||||
else 255
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val binaryCodeOffset = 15
|
|
||||||
|
|
||||||
val cellW = sheet.getSubImage(0, 0).width + 1 // should be 16
|
|
||||||
val cellH = sheet.getSubImage(0, 0).height + 1 // should be 20
|
|
||||||
|
|
||||||
// control chars
|
|
||||||
for (ccode in codeRange) {
|
|
||||||
val glyphX = ccode % rows
|
|
||||||
val glyphY = ccode / rows
|
|
||||||
|
|
||||||
val codeStartX = (glyphX * cellW) + binaryCodeOffset
|
|
||||||
val codeStartY = (glyphY * cellH)
|
|
||||||
|
|
||||||
var glyphWidth = 0
|
|
||||||
for (downCtr in 0..3) {
|
|
||||||
// if alpha is not zero, assume it's 1
|
|
||||||
if (sheet.texture.getPixel(codeStartX, codeStartY + downCtr)[3] == 255) {
|
|
||||||
glyphWidth = glyphWidth or (1 shl downCtr)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
asciiWidths[codeOffset + ccode] = glyphWidth
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
|
|
||||||
lateinit internal var hangulSheet: SpriteSheet
|
|
||||||
lateinit internal var asciiSheet: SpriteSheet
|
|
||||||
|
|
||||||
internal val asciiWidths: HashMap<Int, Int> = HashMap()
|
|
||||||
|
|
||||||
lateinit internal var extASheet: SpriteSheet
|
|
||||||
lateinit internal var kanaSheet: SpriteSheet
|
|
||||||
lateinit internal var cjkPunct: SpriteSheet
|
|
||||||
// static SpriteSheet uniHan;
|
|
||||||
lateinit internal var cyrilic: SpriteSheet
|
|
||||||
lateinit internal var fullwidthForms: SpriteSheet
|
|
||||||
lateinit internal var uniPunct: SpriteSheet
|
|
||||||
lateinit internal var wenQuanYi_1: SpriteSheet
|
|
||||||
lateinit internal var wenQuanYi_2: SpriteSheet
|
|
||||||
lateinit internal var greekSheet: SpriteSheet
|
|
||||||
lateinit internal var romanianSheet: SpriteSheet
|
|
||||||
lateinit internal var romanianSheetNarrow: SpriteSheet
|
|
||||||
|
|
||||||
internal val JUNG_COUNT = 21
|
|
||||||
internal val JONG_COUNT = 28
|
|
||||||
|
|
||||||
internal val W_ASIAN_PUNCT = 10
|
|
||||||
internal val W_HANGUL = 11
|
|
||||||
internal val W_KANA = 12
|
|
||||||
internal val W_UNIHAN = 16
|
|
||||||
internal val W_LATIN_WIDE = 9 // width of regular letters, including m
|
|
||||||
internal val W_LATIN_NARROW = 5 // width of letter f, t, i, l
|
|
||||||
|
|
||||||
internal val H = 20
|
|
||||||
internal val H_HANGUL = 16
|
|
||||||
internal val H_UNIHAN = 16
|
|
||||||
internal val H_KANA = 20
|
|
||||||
|
|
||||||
internal val SHEET_ASCII_VARW = 0
|
|
||||||
internal val SHEET_HANGUL = 1
|
|
||||||
internal val SHEET_EXTA_VARW = 2
|
|
||||||
internal val SHEET_KANA = 3
|
|
||||||
internal val SHEET_CJK_PUNCT = 4
|
|
||||||
internal val SHEET_UNIHAN = 5
|
|
||||||
internal val SHEET_CYRILIC_VARW = 6
|
|
||||||
internal val SHEET_FW_UNI = 7
|
|
||||||
internal val SHEET_UNI_PUNCT = 8
|
|
||||||
internal val SHEET_WENQUANYI_1 = 9
|
|
||||||
internal val SHEET_WENQUANYI_2 = 10
|
|
||||||
internal val SHEET_GREEK_VARW = 11
|
|
||||||
internal val SHEET_EXTB_ROMANIAN_WIDE = 12
|
|
||||||
internal val SHEET_EXTB_ROMANIAN_NARROW = 13
|
|
||||||
|
|
||||||
internal val SHEET_UNKNOWN = 254
|
|
||||||
internal val SHEET_COLOURCODE = 255
|
|
||||||
|
|
||||||
lateinit internal var sheetKey: Array<SpriteSheet?>
|
|
||||||
|
|
||||||
internal var interchar = 0
|
|
||||||
internal var scale = 1
|
|
||||||
set(value) {
|
|
||||||
if (value > 0) field = value
|
|
||||||
else throw IllegalArgumentException("Font scale cannot be zero or negative (input: $value)")
|
|
||||||
}
|
|
||||||
|
|
||||||
}// end of companion object
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Image.drawWithShadow(x: Float, y: Float, color: Color) =
|
|
||||||
this.drawWithShadow(x, y, 1f, color)
|
|
||||||
|
|
||||||
fun Image.drawWithShadow(x: Float, y: Float, scale: Float, color: Color) {
|
|
||||||
this.draw(x + 1, y + 1, scale, color.darker(0.5f))
|
|
||||||
this.draw(x , y + 1, scale, color.darker(0.5f))
|
|
||||||
this.draw(x + 1, y , scale, color.darker(0.5f))
|
|
||||||
|
|
||||||
this.draw(x, y, scale, color)
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
package net.torvald.imagefont
|
|
||||||
|
|
||||||
import net.torvald.terrarum.imagefont.GameFontDemo
|
|
||||||
import org.newdawn.slick.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by minjaesong on 16-01-20.
|
|
||||||
*/
|
|
||||||
class GameFontImpl : GameFontBase() {
|
|
||||||
|
|
||||||
init {
|
|
||||||
|
|
||||||
GameFontBase.hangulSheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/hangul_johab.tga", GameFontBase.W_HANGUL, GameFontBase.H_HANGUL)
|
|
||||||
GameFontBase.asciiSheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/ascii_variable.tga", 15, 19, 1)
|
|
||||||
GameFontBase.extASheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/LatinExtA_variable.tga", 15, 19, 1)
|
|
||||||
GameFontBase.kanaSheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/kana.tga", GameFontBase.W_KANA, GameFontBase.H_KANA)
|
|
||||||
GameFontBase.cjkPunct = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/cjkpunct.tga", GameFontBase.W_ASIAN_PUNCT, GameFontBase.H_KANA)
|
|
||||||
/*uniHan = new SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/unifont_unihan"
|
|
||||||
+ ((!terrarum.gameLocale.contains("zh"))
|
|
||||||
? "_ja" : "")
|
|
||||||
+".tga"
|
|
||||||
, W_UNIHAN, H_UNIHAN
|
|
||||||
);*/
|
|
||||||
GameFontBase.cyrilic = SpriteSheet(
|
|
||||||
when (GameFontDemo.gameLocale.substring(0..1)) {
|
|
||||||
"bg" -> "./assets/graphics/fonts/cyrilic_bulgarian_variable.tga"
|
|
||||||
"sr" -> "./assets/graphics/fonts/cyrilic_serbian_variable.tga"
|
|
||||||
else -> "./assets/graphics/fonts/cyrilic_variable.tga"
|
|
||||||
}, 15, 19, 1)
|
|
||||||
GameFontBase.fullwidthForms = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/fullwidth_forms.tga", GameFontBase.W_UNIHAN, GameFontBase.H_UNIHAN)
|
|
||||||
GameFontBase.uniPunct = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/unipunct.tga", GameFontBase.W_LATIN_WIDE, GameFontBase.H)
|
|
||||||
GameFontBase.wenQuanYi_1 = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/wenquanyi_11pt_part1.tga", 16, 18, 2)
|
|
||||||
GameFontBase.wenQuanYi_2 = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/wenquanyi_11pt_part2.tga", 16, 18, 2)
|
|
||||||
GameFontBase.greekSheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/greek_variable.tga", 15, 19, 1)
|
|
||||||
GameFontBase.romanianSheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/romana_wide.tga", GameFontBase.W_LATIN_WIDE, GameFontBase.H)
|
|
||||||
GameFontBase.romanianSheetNarrow = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/romana_narrow.tga", GameFontBase.W_LATIN_NARROW, GameFontBase.H)
|
|
||||||
|
|
||||||
val shk = arrayOf(
|
|
||||||
GameFontBase.asciiSheet,
|
|
||||||
GameFontBase.hangulSheet,
|
|
||||||
GameFontBase.extASheet,
|
|
||||||
GameFontBase.kanaSheet,
|
|
||||||
GameFontBase.cjkPunct,
|
|
||||||
null, // Full unihan, filler because we're using WenQuanYi
|
|
||||||
GameFontBase.cyrilic,
|
|
||||||
GameFontBase.fullwidthForms,
|
|
||||||
GameFontBase.uniPunct,
|
|
||||||
GameFontBase.wenQuanYi_1,
|
|
||||||
GameFontBase.wenQuanYi_2,
|
|
||||||
GameFontBase.greekSheet,
|
|
||||||
GameFontBase.romanianSheet,
|
|
||||||
GameFontBase.romanianSheetNarrow
|
|
||||||
)
|
|
||||||
GameFontBase.sheetKey = shk
|
|
||||||
|
|
||||||
|
|
||||||
buildWidthTable(asciiSheet, 0, 0..0xFF)
|
|
||||||
buildWidthTable(extASheet, 0x100, 0..0x7F)
|
|
||||||
buildWidthTable(cyrilic, 0x400, 0..0x5F)
|
|
||||||
buildWidthTable(greekSheet, 0x370, 0..0x5F)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Font implementations for Slick2d
|
|
||||||
BIN
TerrarumSansBitmap.jar
Normal file
BIN
alignment_illustration.jpg
Normal file
|
After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 160 KiB |
BIN
assets/LatinExtB_variable.tga
Normal file
|
After Width: | Height: | Size: 260 KiB |
|
Before Width: | Height: | Size: 320 KiB After Width: | Height: | Size: 320 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
BIN
assets/cyrilic_variable.tga
Normal file
|
After Width: | Height: | Size: 380 KiB |
BIN
assets/devanagari_bengali_variable.tga
Normal file
|
After Width: | Height: | Size: 320 KiB |
BIN
assets/fullwidth_forms.tga
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
assets/futhark.tga
Normal file
|
After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 444 B |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 19 MiB |
|
Before Width: | Height: | Size: 19 MiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 262 KiB |
BIN
assets/hayeren_variable.tga
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
assets/insular_variable.tga
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
assets/ipa_ext_variable.tga
Normal file
|
After Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 210 KiB |
BIN
assets/kartuli_allcaps_variable.tga
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
assets/kartuli_variable.tga
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
assets/latinExt_additional_variable.tga
Normal file
|
After Width: | Height: | Size: 320 KiB |
BIN
assets/puae000-e0ff.tga
Normal file
|
After Width: | Height: | Size: 324 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 120 KiB |
BIN
assets/wenquanyi.tga.gz
Normal file
1
demo/.idea/.name
generated
@@ -1 +0,0 @@
|
|||||||
TerrarumSansDemo
|
|
||||||
15
demo/.idea/artifacts/unnamed.xml
generated
@@ -1,15 +0,0 @@
|
|||||||
<component name="ArtifactManager">
|
|
||||||
<artifact type="jar" name="unnamed">
|
|
||||||
<output-path>$PROJECT_DIR$/out/artifacts/unnamed</output-path>
|
|
||||||
<root id="archive" name="TerrarumSansDemo.jar">
|
|
||||||
<element id="directory" name="META-INF">
|
|
||||||
<element id="file-copy" path="$PROJECT_DIR$/META-INF/MANIFEST.MF" />
|
|
||||||
</element>
|
|
||||||
<element id="file-copy" path="$PROJECT_DIR$/../LICENSE.md" />
|
|
||||||
<element id="file-copy" path="$PROJECT_DIR$/config.properties" />
|
|
||||||
<element id="file-copy" path="$PROJECT_DIR$/text.txt" />
|
|
||||||
<element id="dir-copy" path="$PROJECT_DIR$/lib" />
|
|
||||||
<element id="module-output" name="TerrarumSansDemo" />
|
|
||||||
</root>
|
|
||||||
</artifact>
|
|
||||||
</component>
|
|
||||||
8
demo/.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/TerrarumSansDemo.iml" filepath="$PROJECT_DIR$/TerrarumSansDemo.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
610
demo/.idea/workspace.xml
generated
@@ -1,610 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ArtifactsWorkspaceSettings">
|
|
||||||
<artifacts-to-build>
|
|
||||||
<artifact name="unnamed" />
|
|
||||||
</artifacts-to-build>
|
|
||||||
</component>
|
|
||||||
<component name="BookmarkManager">
|
|
||||||
<bookmark url="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt" line="46" mnemonic="9" />
|
|
||||||
</component>
|
|
||||||
<component name="ChangeListManager">
|
|
||||||
<list default="true" id="fcc8c48a-4440-438f-9e38-d42425b5efd4" name="Default" comment="" />
|
|
||||||
<ignored path="$PROJECT_DIR$/out/" />
|
|
||||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
|
||||||
<option name="TRACKING_ENABLED" value="true" />
|
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
||||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
||||||
</component>
|
|
||||||
<component name="CreatePatchCommitExecutor">
|
|
||||||
<option name="PATCH_PATH" value="" />
|
|
||||||
</component>
|
|
||||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
|
||||||
<component name="FileEditorManager">
|
|
||||||
<leaf>
|
|
||||||
<file leaf-file-name="GameFontDemo.kt" pinned="false" current-in-tab="true">
|
|
||||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="610">
|
|
||||||
<caret line="72" column="55" lean-forward="false" selection-start-line="72" selection-start-column="55" selection-end-line="72" selection-end-column="55" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#40#238#0" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
<file leaf-file-name="GameFontBase.kt" pinned="false" current-in-tab="false">
|
|
||||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontBase.kt">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="400">
|
|
||||||
<caret line="516" column="36" lean-forward="false" selection-start-line="516" selection-start-column="36" selection-end-line="516" selection-end-column="36" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#31#171#0" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
<file leaf-file-name="config.properties" pinned="false" current-in-tab="false">
|
|
||||||
<entry file="file://$PROJECT_DIR$/config.properties">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="0">
|
|
||||||
<caret line="0" column="10" lean-forward="true" selection-start-line="0" selection-start-column="10" selection-end-line="0" selection-end-column="10" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
<file leaf-file-name="text.txt" pinned="false" current-in-tab="false">
|
|
||||||
<entry file="file://$PROJECT_DIR$/text.txt">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="0">
|
|
||||||
<caret line="0" column="95" lean-forward="false" selection-start-line="0" selection-start-column="95" selection-end-line="0" selection-end-column="95" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
<file leaf-file-name="GameFontImpl.kt" pinned="false" current-in-tab="false">
|
|
||||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontImpl.kt">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="190">
|
|
||||||
<caret line="29" column="0" lean-forward="false" selection-start-line="29" selection-start-column="0" selection-end-line="29" selection-end-column="0" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#31#108#0" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
</leaf>
|
|
||||||
</component>
|
|
||||||
<component name="FileTemplateManagerImpl">
|
|
||||||
<option name="RECENT_TEMPLATES">
|
|
||||||
<list>
|
|
||||||
<option value="Kotlin File" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="FindInProjectRecents">
|
|
||||||
<findStrings>
|
|
||||||
<find>"|</find>
|
|
||||||
<find>,\n</find>
|
|
||||||
<find>main</find>
|
|
||||||
</findStrings>
|
|
||||||
<replaceStrings>
|
|
||||||
<replace>\n</replace>
|
|
||||||
</replaceStrings>
|
|
||||||
</component>
|
|
||||||
<component name="GradleLocalSettings">
|
|
||||||
<option name="modificationStamps">
|
|
||||||
<map>
|
|
||||||
<entry key="$PROJECT_DIR$/../../terrarum_renewed" value="2962360935090" />
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
<option name="externalProjectsViewState">
|
|
||||||
<projects_view />
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="IdeDocumentHistory">
|
|
||||||
<option name="CHANGED_PATHS">
|
|
||||||
<list>
|
|
||||||
<option value="$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontImpl.kt" />
|
|
||||||
<option value="$PROJECT_DIR$/text.properties" />
|
|
||||||
<option value="$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontBase.kt" />
|
|
||||||
<option value="$PROJECT_DIR$/text.txt" />
|
|
||||||
<option value="$PROJECT_DIR$/config.properties" />
|
|
||||||
<option value="$PROJECT_DIR$/META-INF/MANIFEST.MF" />
|
|
||||||
<option value="$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="ProjectFrameBounds">
|
|
||||||
<option name="x" value="-8" />
|
|
||||||
<option name="y" value="-8" />
|
|
||||||
<option name="width" value="1936" />
|
|
||||||
<option name="height" value="1176" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectView">
|
|
||||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
|
||||||
<flattenPackages />
|
|
||||||
<showMembers />
|
|
||||||
<showModules />
|
|
||||||
<showLibraryContents />
|
|
||||||
<hideEmptyPackages />
|
|
||||||
<abbreviatePackageNames />
|
|
||||||
<autoscrollToSource />
|
|
||||||
<autoscrollFromSource />
|
|
||||||
<sortByType />
|
|
||||||
<manualOrder />
|
|
||||||
<foldersAlwaysOnTop value="true" />
|
|
||||||
</navigator>
|
|
||||||
<panes>
|
|
||||||
<pane id="ProjectPane">
|
|
||||||
<subPane>
|
|
||||||
<PATH>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="TerrarumSansDemo" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="demo" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
</PATH>
|
|
||||||
<PATH>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="TerrarumSansDemo" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="demo" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="src" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="imagefont" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
</PATH>
|
|
||||||
<PATH>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="TerrarumSansDemo" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="demo" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="META-INF" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
</PATH>
|
|
||||||
</subPane>
|
|
||||||
</pane>
|
|
||||||
<pane id="PackagesPane" />
|
|
||||||
<pane id="Scope" />
|
|
||||||
<pane id="Scratches" />
|
|
||||||
</panes>
|
|
||||||
</component>
|
|
||||||
<component name="PropertiesComponent">
|
|
||||||
<property name="settings.editor.selected.configurable" value="project.kotlinCompiler" />
|
|
||||||
<property name="settings.editor.splitter.proportion" value="0.2" />
|
|
||||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/lib" />
|
|
||||||
<property name="project.structure.last.edited" value="Artifacts" />
|
|
||||||
<property name="project.structure.proportion" value="0.15" />
|
|
||||||
<property name="project.structure.side.proportion" value="0.32068965" />
|
|
||||||
</component>
|
|
||||||
<component name="RunManager" selected="Kotlin.net.torvald.terrarum.imagefont.GameFontDemoKt">
|
|
||||||
<configuration default="false" name="net.torvald.terrarum.imagefont.GameFontDemoKt" type="JetRunConfigurationType" factoryName="Kotlin" temporary="true" nameIsGenerated="true">
|
|
||||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
|
||||||
<option name="MAIN_CLASS_NAME" value="net.torvald.terrarum.imagefont.GameFontDemoKt" />
|
|
||||||
<option name="VM_PARAMETERS" />
|
|
||||||
<option name="PROGRAM_PARAMETERS" />
|
|
||||||
<option name="WORKING_DIRECTORY" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
|
||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
|
||||||
<module name="TerrarumSansDemo" />
|
|
||||||
<envs />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
|
||||||
<module name="" />
|
|
||||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
|
||||||
<option name="PROGRAM_PARAMETERS" />
|
|
||||||
<predefined_log_file id="idea.log" enabled="true" />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="Applet" factoryName="Applet">
|
|
||||||
<option name="HTML_USED" value="false" />
|
|
||||||
<option name="WIDTH" value="400" />
|
|
||||||
<option name="HEIGHT" value="300" />
|
|
||||||
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
|
|
||||||
<module />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="Application" factoryName="Application">
|
|
||||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
|
||||||
<option name="MAIN_CLASS_NAME" />
|
|
||||||
<option name="VM_PARAMETERS" />
|
|
||||||
<option name="PROGRAM_PARAMETERS" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
|
||||||
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
|
||||||
<option name="ENV_VARIABLES" />
|
|
||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
|
||||||
<module name="" />
|
|
||||||
<envs />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
|
|
||||||
<ExternalSystemSettings>
|
|
||||||
<option name="executionName" />
|
|
||||||
<option name="externalProjectPath" />
|
|
||||||
<option name="externalSystemIdString" value="GRADLE" />
|
|
||||||
<option name="scriptParameters" />
|
|
||||||
<option name="taskDescriptions">
|
|
||||||
<list />
|
|
||||||
</option>
|
|
||||||
<option name="taskNames">
|
|
||||||
<list />
|
|
||||||
</option>
|
|
||||||
<option name="vmOptions" />
|
|
||||||
</ExternalSystemSettings>
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="JUnit" factoryName="JUnit">
|
|
||||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
|
||||||
<module name="" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
|
||||||
<option name="PACKAGE_NAME" />
|
|
||||||
<option name="MAIN_CLASS_NAME" />
|
|
||||||
<option name="METHOD_NAME" />
|
|
||||||
<option name="TEST_OBJECT" value="class" />
|
|
||||||
<option name="VM_PARAMETERS" value="-ea" />
|
|
||||||
<option name="PARAMETERS" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
|
||||||
<option name="ENV_VARIABLES" />
|
|
||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
|
||||||
<option name="TEST_SEARCH_SCOPE">
|
|
||||||
<value defaultName="singleModule" />
|
|
||||||
</option>
|
|
||||||
<envs />
|
|
||||||
<patterns />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="JarApplication" factoryName="JAR Application">
|
|
||||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
|
||||||
<envs />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="Java Scratch" factoryName="Java Scratch">
|
|
||||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
|
||||||
<option name="SCRATCH_FILE_ID" value="0" />
|
|
||||||
<option name="MAIN_CLASS_NAME" />
|
|
||||||
<option name="VM_PARAMETERS" />
|
|
||||||
<option name="PROGRAM_PARAMETERS" />
|
|
||||||
<option name="WORKING_DIRECTORY" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
|
||||||
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
|
||||||
<option name="ENV_VARIABLES" />
|
|
||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
|
||||||
<module name="" />
|
|
||||||
<envs />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
|
|
||||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
|
||||||
<option name="MAIN_CLASS_NAME" />
|
|
||||||
<option name="VM_PARAMETERS" />
|
|
||||||
<option name="PROGRAM_PARAMETERS" />
|
|
||||||
<option name="WORKING_DIRECTORY" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
|
||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
|
||||||
<module name="TerrarumSansDemo" />
|
|
||||||
<envs />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script">
|
|
||||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
|
||||||
<option name="filePath" />
|
|
||||||
<option name="vmParameters" />
|
|
||||||
<option name="alternativeJrePath" />
|
|
||||||
<option name="programParameters" />
|
|
||||||
<option name="passParentEnvs" value="true" />
|
|
||||||
<option name="workingDirectory" />
|
|
||||||
<option name="isAlternativeJrePathEnabled" value="false" />
|
|
||||||
<envs />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="Remote" factoryName="Remote">
|
|
||||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
|
||||||
<option name="SERVER_MODE" value="false" />
|
|
||||||
<option name="SHMEM_ADDRESS" value="javadebug" />
|
|
||||||
<option name="HOST" value="localhost" />
|
|
||||||
<option name="PORT" value="5005" />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="TestNG" factoryName="TestNG">
|
|
||||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
|
||||||
<module name="" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
|
||||||
<option name="SUITE_NAME" />
|
|
||||||
<option name="PACKAGE_NAME" />
|
|
||||||
<option name="MAIN_CLASS_NAME" />
|
|
||||||
<option name="METHOD_NAME" />
|
|
||||||
<option name="GROUP_NAME" />
|
|
||||||
<option name="TEST_OBJECT" value="CLASS" />
|
|
||||||
<option name="VM_PARAMETERS" value="-ea" />
|
|
||||||
<option name="PARAMETERS" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
|
||||||
<option name="OUTPUT_DIRECTORY" />
|
|
||||||
<option name="ANNOTATION_TYPE" />
|
|
||||||
<option name="ENV_VARIABLES" />
|
|
||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
|
||||||
<option name="TEST_SEARCH_SCOPE">
|
|
||||||
<value defaultName="singleModule" />
|
|
||||||
</option>
|
|
||||||
<option name="USE_DEFAULT_REPORTERS" value="false" />
|
|
||||||
<option name="PROPERTIES_FILE" />
|
|
||||||
<envs />
|
|
||||||
<properties />
|
|
||||||
<listeners />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="executeSpecs" factoryName="Gauge Execution">
|
|
||||||
<setting name="environment" value="" />
|
|
||||||
<setting name="specsToExecute" value="" />
|
|
||||||
<setting name="tags" value="" />
|
|
||||||
<setting name="parallelNodes" value="" />
|
|
||||||
<setting name="execInParallel" value="false" />
|
|
||||||
<setting name="programParameters" value="" />
|
|
||||||
<setting name="workingDirectory" value="" />
|
|
||||||
<setting name="moduleName" value="" />
|
|
||||||
<envMap />
|
|
||||||
<setting name="rowsRange" value="" />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<list size="1">
|
|
||||||
<item index="0" class="java.lang.String" itemvalue="Kotlin.net.torvald.terrarum.imagefont.GameFontDemoKt" />
|
|
||||||
</list>
|
|
||||||
<recent_temporary>
|
|
||||||
<list size="1">
|
|
||||||
<item index="0" class="java.lang.String" itemvalue="Kotlin.net.torvald.terrarum.imagefont.GameFontDemoKt" />
|
|
||||||
</list>
|
|
||||||
</recent_temporary>
|
|
||||||
</component>
|
|
||||||
<component name="ShelveChangesManager" show_recycled="false">
|
|
||||||
<option name="remove_strategy" value="false" />
|
|
||||||
</component>
|
|
||||||
<component name="SvnConfiguration">
|
|
||||||
<configuration />
|
|
||||||
</component>
|
|
||||||
<component name="TaskManager">
|
|
||||||
<task active="true" id="Default" summary="Default task">
|
|
||||||
<changelist id="fcc8c48a-4440-438f-9e38-d42425b5efd4" name="Default" comment="" />
|
|
||||||
<created>1487243351068</created>
|
|
||||||
<option name="number" value="Default" />
|
|
||||||
<option name="presentableId" value="Default" />
|
|
||||||
<updated>1487243351068</updated>
|
|
||||||
</task>
|
|
||||||
<servers />
|
|
||||||
</component>
|
|
||||||
<component name="ToolWindowManager">
|
|
||||||
<frame x="-8" y="-8" width="1936" height="1176" extended-state="6" />
|
|
||||||
<editor active="true" />
|
|
||||||
<layout>
|
|
||||||
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32917467" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Palette	" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
|
||||||
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32960597" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3292683" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17948718" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
|
||||||
<window_info id="LuaJ" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32960597" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Structure" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3054371" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="true" content_ui="tabs" />
|
|
||||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.26007676" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="9" side_tool="false" content_ui="combo" />
|
|
||||||
<window_info id="Code Iris" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.32960597" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Documentation" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.1544196" sideWeight="0.4651163" order="10" side_tool="false" content_ui="tabs" x="1380" y="-157" width="1720" height="857" />
|
|
||||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Gradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
|
||||||
</layout>
|
|
||||||
</component>
|
|
||||||
<component name="VcsContentAnnotationSettings">
|
|
||||||
<option name="myLimit" value="2678400000" />
|
|
||||||
</component>
|
|
||||||
<component name="XDebuggerManager">
|
|
||||||
<breakpoint-manager />
|
|
||||||
<watches-manager />
|
|
||||||
</component>
|
|
||||||
<component name="antWorkspaceConfiguration">
|
|
||||||
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
|
|
||||||
<option name="FILTER_TARGETS" value="false" />
|
|
||||||
</component>
|
|
||||||
<component name="editorHistoryManager">
|
|
||||||
<entry file="file://$PROJECT_DIR$/text.txt">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="0">
|
|
||||||
<caret line="0" column="95" lean-forward="false" selection-start-line="0" selection-start-column="95" selection-end-line="0" selection-end-column="95" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontImpl.kt">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="190">
|
|
||||||
<caret line="29" column="0" lean-forward="false" selection-start-line="29" selection-start-column="0" selection-end-line="29" selection-end-column="0" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#31#108#0" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/META-INF/MANIFEST.MF">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="28">
|
|
||||||
<caret line="2" column="57" lean-forward="true" selection-start-line="2" selection-start-column="57" selection-end-line="2" selection-end-column="57" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontBase.kt">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="400">
|
|
||||||
<caret line="516" column="36" lean-forward="false" selection-start-line="516" selection-start-column="36" selection-end-line="516" selection-end-column="36" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#31#171#0" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/../../Ba-AA/src/net/torvald/aa/demoplayer/BaAA.java">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="273">
|
|
||||||
<caret line="428" column="8" lean-forward="false" selection-start-line="428" selection-start-column="8" selection-end-line="429" selection-end-column="87" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/config.properties">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="0">
|
|
||||||
<caret line="0" column="10" lean-forward="true" selection-start-line="0" selection-start-column="10" selection-end-line="0" selection-end-column="10" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarum/imagefont/GameFontDemo.kt">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="610">
|
|
||||||
<caret line="72" column="55" lean-forward="false" selection-start-line="72" selection-start-column="55" selection-end-line="72" selection-end-column="55" />
|
|
||||||
<folding>
|
|
||||||
<element signature="e#40#238#0" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</component>
|
|
||||||
<component name="masterDetails">
|
|
||||||
<states>
|
|
||||||
<state key="ArtifactsStructureConfigurable.UI">
|
|
||||||
<settings>
|
|
||||||
<artifact-editor>
|
|
||||||
<show-content>
|
|
||||||
<type id="artifact" />
|
|
||||||
<type id="library" />
|
|
||||||
</show-content>
|
|
||||||
</artifact-editor>
|
|
||||||
<last-edited>unnamed</last-edited>
|
|
||||||
<splitter-proportions>
|
|
||||||
<option name="proportions">
|
|
||||||
<list>
|
|
||||||
<option value="0.32068965" />
|
|
||||||
<option value="0.5" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</splitter-proportions>
|
|
||||||
</settings>
|
|
||||||
</state>
|
|
||||||
<state key="FacetStructureConfigurable.UI">
|
|
||||||
<settings>
|
|
||||||
<last-edited>Kotlin</last-edited>
|
|
||||||
<splitter-proportions>
|
|
||||||
<option name="proportions">
|
|
||||||
<list>
|
|
||||||
<option value="0.32068965" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</splitter-proportions>
|
|
||||||
</settings>
|
|
||||||
</state>
|
|
||||||
<state key="GlobalLibrariesConfigurable.UI">
|
|
||||||
<settings>
|
|
||||||
<splitter-proportions>
|
|
||||||
<option name="proportions">
|
|
||||||
<list>
|
|
||||||
<option value="0.2" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</splitter-proportions>
|
|
||||||
</settings>
|
|
||||||
</state>
|
|
||||||
<state key="JdkListConfigurable.UI">
|
|
||||||
<settings>
|
|
||||||
<last-edited>1.8</last-edited>
|
|
||||||
<splitter-proportions>
|
|
||||||
<option name="proportions">
|
|
||||||
<list>
|
|
||||||
<option value="0.2" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</splitter-proportions>
|
|
||||||
</settings>
|
|
||||||
</state>
|
|
||||||
<state key="ModuleStructureConfigurable.UI">
|
|
||||||
<settings>
|
|
||||||
<last-edited>TerrarumSansDemo</last-edited>
|
|
||||||
<splitter-proportions>
|
|
||||||
<option name="proportions">
|
|
||||||
<list>
|
|
||||||
<option value="0.32068965" />
|
|
||||||
<option value="0.6" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</splitter-proportions>
|
|
||||||
</settings>
|
|
||||||
</state>
|
|
||||||
<state key="ProjectJDKs.UI">
|
|
||||||
<settings>
|
|
||||||
<last-edited>1.8</last-edited>
|
|
||||||
<splitter-proportions>
|
|
||||||
<option name="proportions">
|
|
||||||
<list>
|
|
||||||
<option value="0.2" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</splitter-proportions>
|
|
||||||
</settings>
|
|
||||||
</state>
|
|
||||||
<state key="ProjectLibrariesConfigurable.UI">
|
|
||||||
<settings>
|
|
||||||
<last-edited>KotlinJavaRuntime</last-edited>
|
|
||||||
<splitter-proportions>
|
|
||||||
<option name="proportions">
|
|
||||||
<list>
|
|
||||||
<option value="0.32068965" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</splitter-proportions>
|
|
||||||
</settings>
|
|
||||||
</state>
|
|
||||||
</states>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
Manifest-Version: 1.0
|
|
||||||
Class-Path: lib/lwjgl.jar lib/lwjgl_util.jar lib/slick.jar lib/kotlin-reflect.jar lib/kotlin-runtime.jar
|
|
||||||
Main-Class: net.torvald.terrarum.imagefont.GameFontDemoKt
|
|
||||||
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="FacetManager">
|
|
||||||
<facet type="kotlin-language" name="Kotlin">
|
|
||||||
<configuration version="1">
|
|
||||||
<option name="compilerInfo">
|
|
||||||
<KotlinCompilerInfo>
|
|
||||||
<option name="compilerSettings">
|
|
||||||
<CompilerSettings>
|
|
||||||
<option name="additionalArguments" value="-version" />
|
|
||||||
<option name="copyJsLibraryFiles" value="true" />
|
|
||||||
<option name="outputDirectoryForJsLibraryFiles" value="lib" />
|
|
||||||
</CompilerSettings>
|
|
||||||
</option>
|
|
||||||
<option name="k2jsCompilerArguments">
|
|
||||||
<K2JSCompilerArguments>
|
|
||||||
<option name="outputFile" />
|
|
||||||
<option name="noStdlib" value="false" />
|
|
||||||
<option name="libraryFiles" />
|
|
||||||
<option name="sourceMap" value="false" />
|
|
||||||
<option name="metaInfo" value="false" />
|
|
||||||
<option name="kjsm" value="false" />
|
|
||||||
<option name="target" />
|
|
||||||
<option name="moduleKind" />
|
|
||||||
<option name="main" />
|
|
||||||
<option name="outputPrefix" />
|
|
||||||
<option name="outputPostfix" />
|
|
||||||
<option name="languageVersion" />
|
|
||||||
<option name="apiVersion" />
|
|
||||||
<option name="suppressWarnings" value="false" />
|
|
||||||
<option name="verbose" value="false" />
|
|
||||||
<option name="version" value="false" />
|
|
||||||
<option name="help" value="false" />
|
|
||||||
<option name="extraHelp" value="false" />
|
|
||||||
<option name="noInline" value="false" />
|
|
||||||
<option name="repeat" />
|
|
||||||
<option name="pluginClasspaths" />
|
|
||||||
<option name="pluginOptions" />
|
|
||||||
<option name="freeArgs">
|
|
||||||
<list />
|
|
||||||
</option>
|
|
||||||
<option name="unknownExtraFlags">
|
|
||||||
<list />
|
|
||||||
</option>
|
|
||||||
</K2JSCompilerArguments>
|
|
||||||
</option>
|
|
||||||
<option name="_commonCompilerArguments">
|
|
||||||
<DummyImpl>
|
|
||||||
<option name="languageVersion" />
|
|
||||||
<option name="apiVersion" />
|
|
||||||
<option name="suppressWarnings" value="false" />
|
|
||||||
<option name="verbose" value="false" />
|
|
||||||
<option name="version" value="false" />
|
|
||||||
<option name="help" value="false" />
|
|
||||||
<option name="extraHelp" value="false" />
|
|
||||||
<option name="noInline" value="false" />
|
|
||||||
<option name="repeat" />
|
|
||||||
<option name="pluginClasspaths" />
|
|
||||||
<option name="pluginOptions" />
|
|
||||||
<option name="freeArgs">
|
|
||||||
<list />
|
|
||||||
</option>
|
|
||||||
<option name="unknownExtraFlags">
|
|
||||||
<list />
|
|
||||||
</option>
|
|
||||||
</DummyImpl>
|
|
||||||
</option>
|
|
||||||
</KotlinCompilerInfo>
|
|
||||||
</option>
|
|
||||||
<option name="versionInfo">
|
|
||||||
<KotlinVersionInfo>
|
|
||||||
<option name="apiLevel" value="1.0" />
|
|
||||||
<option name="languageLevel" value="1.0" />
|
|
||||||
<option name="targetPlatformName" value="JVM 1.6" />
|
|
||||||
</KotlinVersionInfo>
|
|
||||||
</option>
|
|
||||||
</configuration>
|
|
||||||
</facet>
|
|
||||||
</component>
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
locale=enUS
|
|
||||||
@@ -1,552 +0,0 @@
|
|||||||
package net.torvald.imagefont
|
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11
|
|
||||||
import org.newdawn.slick.*
|
|
||||||
import org.newdawn.slick.opengl.Texture
|
|
||||||
import java.nio.ByteOrder
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by minjaesong on 16-01-27.
|
|
||||||
*/
|
|
||||||
open class GameFontBase : Font {
|
|
||||||
|
|
||||||
private fun getHan(hanIndex: Int): IntArray {
|
|
||||||
val han_x = hanIndex % JONG_COUNT
|
|
||||||
val han_y = hanIndex / JONG_COUNT
|
|
||||||
val ret = intArrayOf(han_x, han_y)
|
|
||||||
return ret
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getHanChosung(hanIndex: Int) = hanIndex / (JUNG_COUNT * JONG_COUNT)
|
|
||||||
|
|
||||||
private fun getHanJungseong(hanIndex: Int) = hanIndex / JONG_COUNT % JUNG_COUNT
|
|
||||||
|
|
||||||
private fun getHanJongseong(hanIndex: Int) = hanIndex % JONG_COUNT
|
|
||||||
|
|
||||||
private val jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
|
|
||||||
private val jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
|
|
||||||
|
|
||||||
private fun isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
|
|
||||||
private fun isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
|
|
||||||
|
|
||||||
private fun getHanInitialRow(hanIndex: Int): Int {
|
|
||||||
val ret: Int
|
|
||||||
|
|
||||||
if (isJungseongWide(hanIndex))
|
|
||||||
ret = 2
|
|
||||||
else if (isJungseongComplex(hanIndex))
|
|
||||||
ret = 4
|
|
||||||
else
|
|
||||||
ret = 0
|
|
||||||
|
|
||||||
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
|
|
||||||
|
|
||||||
private fun getHanFinalRow(hanIndex: Int): Int {
|
|
||||||
val jungseongIndex = getHanJungseong(hanIndex)
|
|
||||||
|
|
||||||
return if (jungseongWide.contains(jungseongIndex))
|
|
||||||
8
|
|
||||||
else
|
|
||||||
9
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun isHangul(c: Char) = c.toInt() >= 0xAC00 && c.toInt() < 0xD7A4
|
|
||||||
private fun isAscii(c: Char) = c.toInt() >= 0x20 && c.toInt() <= 0xFF
|
|
||||||
private fun isExtA(c: Char) = c.toInt() >= 0x100 && c.toInt() < 0x180
|
|
||||||
private fun isKana(c: Char) = c.toInt() >= 0x3040 && c.toInt() < 0x3100
|
|
||||||
private fun isCJKPunct(c: Char) = c.toInt() >= 0x3000 && c.toInt() < 0x3040
|
|
||||||
private fun isUniHan(c: Char) = c.toInt() >= 0x3400 && c.toInt() < 0xA000
|
|
||||||
private fun isCyrilic(c: Char) = c.toInt() >= 0x400 && c.toInt() < 0x460
|
|
||||||
private fun isFullwidthUni(c: Char) = c.toInt() >= 0xFF00 && c.toInt() < 0xFF20
|
|
||||||
private fun isUniPunct(c: Char) = c.toInt() >= 0x2000 && c.toInt() < 0x2070
|
|
||||||
private fun isWenQuanYi1(c: Char) = c.toInt() >= 0x33F3 && c.toInt() <= 0x69FC
|
|
||||||
private fun isWenQuanYi2(c: Char) = c.toInt() >= 0x69FD && c.toInt() <= 0x9FDC
|
|
||||||
private fun isGreek(c: Char) = c.toInt() >= 0x370 && c.toInt() <= 0x3CE
|
|
||||||
private fun isRomanian(c: Char) = c.toInt() >= 0x218 && c.toInt() <= 0x21A
|
|
||||||
private fun isRomanianNarrow(c: Char) = c.toInt() == 0x21B
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private fun extAindexX(c: Char) = (c.toInt() - 0x100) % 16
|
|
||||||
private fun extAindexY(c: Char) = (c.toInt() - 0x100) / 16
|
|
||||||
|
|
||||||
private fun kanaIndexX(c: Char) = (c.toInt() - 0x3040) % 16
|
|
||||||
private fun kanaIndexY(c: Char) = (c.toInt() - 0x3040) / 16
|
|
||||||
|
|
||||||
private fun cjkPunctIndexX(c: Char) = (c.toInt() - 0x3000) % 16
|
|
||||||
private fun cjkPunctIndexY(c: Char) = (c.toInt() - 0x3000) / 16
|
|
||||||
|
|
||||||
private fun uniHanIndexX(c: Char) = (c.toInt() - 0x3400) % 256
|
|
||||||
private fun uniHanIndexY(c: Char) = (c.toInt() - 0x3400) / 256
|
|
||||||
|
|
||||||
private fun cyrilicIndexX(c: Char) = (c.toInt() - 0x400) % 16
|
|
||||||
private fun cyrilicIndexY(c: Char) = (c.toInt() - 0x400) / 16
|
|
||||||
|
|
||||||
private fun fullwidthUniIndexX(c: Char) = (c.toInt() - 0xFF00) % 16
|
|
||||||
private fun fullwidthUniIndexY(c: Char) = (c.toInt() - 0xFF00) / 16
|
|
||||||
|
|
||||||
private fun uniPunctIndexX(c: Char) = (c.toInt() - 0x2000) % 16
|
|
||||||
private fun uniPunctIndexY(c: Char) = (c.toInt() - 0x2000) / 16
|
|
||||||
|
|
||||||
private fun wenQuanYiIndexX(c: Char) =
|
|
||||||
(c.toInt() - if (c.toInt() <= 0x4DB5) 0x33F3 else 0x33F3 + 0x4A) % 32
|
|
||||||
private fun wenQuanYi1IndexY(c: Char) = (c.toInt() - (0x33F3 + 0x4A)) / 32
|
|
||||||
private fun wenQuanYi2IndexY(c: Char) = (c.toInt() - 0x69FD) / 32
|
|
||||||
|
|
||||||
private fun greekIndexX(c: Char) = (c.toInt() - 0x370) % 16
|
|
||||||
private fun greekIndexY(c: Char) = (c.toInt() - 0x370) / 16
|
|
||||||
|
|
||||||
private fun romanianIndexX(c: Char) = c.toInt() - 0x218
|
|
||||||
private fun romanianIndexY(c: Char) = 0
|
|
||||||
|
|
||||||
private fun thaiIndexX(c: Char) = (c.toInt() - 0xE00) % 16
|
|
||||||
private fun thaiIndexY(c: Char) = (c.toInt() - 0xE00) / 16
|
|
||||||
|
|
||||||
private fun thaiNarrowIndexX(c: Char) = 3
|
|
||||||
private fun thaiNarrowIndexY(c: Char) = 0
|
|
||||||
|
|
||||||
|
|
||||||
private val narrowWidthSheets = arrayOf(
|
|
||||||
SHEET_EXTB_ROMANIAN_NARROW
|
|
||||||
)
|
|
||||||
private val unihanWidthSheets = arrayOf(
|
|
||||||
SHEET_UNIHAN,
|
|
||||||
SHEET_FW_UNI,
|
|
||||||
SHEET_WENQUANYI_1,
|
|
||||||
SHEET_WENQUANYI_2
|
|
||||||
)
|
|
||||||
private val zeroWidthSheets = arrayOf(
|
|
||||||
SHEET_COLOURCODE
|
|
||||||
)
|
|
||||||
private val variableWidthSheets = arrayOf(
|
|
||||||
SHEET_ASCII_VARW,
|
|
||||||
SHEET_CYRILIC_VARW,
|
|
||||||
SHEET_EXTA_VARW,
|
|
||||||
SHEET_GREEK_VARW
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
override fun getWidth(s: String) = getWidthSubstr(s, s.length)
|
|
||||||
|
|
||||||
private fun getWidthSubstr(s: String, endIndex: Int): Int {
|
|
||||||
var len = 0
|
|
||||||
for (i in 0..endIndex - 1) {
|
|
||||||
val chr = s[i]
|
|
||||||
val ctype = getSheetType(s[i])
|
|
||||||
|
|
||||||
if (chr.toInt() == 0x21B) // Romanian t; HAX!
|
|
||||||
len += 6
|
|
||||||
else if (variableWidthSheets.contains(ctype)) {
|
|
||||||
try {
|
|
||||||
len += asciiWidths[chr.toInt()]!!
|
|
||||||
}
|
|
||||||
catch (e: kotlin.KotlinNullPointerException) {
|
|
||||||
println("KotlinNullPointerException on glyph number ${Integer.toHexString(chr.toInt()).toUpperCase()}")
|
|
||||||
System.exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (zeroWidthSheets.contains(ctype))
|
|
||||||
len += 0
|
|
||||||
else if (narrowWidthSheets.contains(ctype))
|
|
||||||
len += W_LATIN_NARROW
|
|
||||||
else if (ctype == SHEET_CJK_PUNCT)
|
|
||||||
len += W_ASIAN_PUNCT
|
|
||||||
else if (ctype == SHEET_HANGUL)
|
|
||||||
len += W_HANGUL
|
|
||||||
else if (ctype == SHEET_KANA)
|
|
||||||
len += W_KANA
|
|
||||||
else if (unihanWidthSheets.contains(ctype))
|
|
||||||
len += W_UNIHAN
|
|
||||||
else
|
|
||||||
len += W_LATIN_WIDE
|
|
||||||
|
|
||||||
if (i < endIndex - 1) len += interchar
|
|
||||||
}
|
|
||||||
return len * scale
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getHeight(s: String) = H * scale
|
|
||||||
|
|
||||||
override fun getLineHeight() = H * scale
|
|
||||||
|
|
||||||
override fun drawString(x: Float, y: Float, s: String) = drawString(x, y, s, Color.white)
|
|
||||||
|
|
||||||
override fun drawString(x: Float, y: Float, s: String, color: Color) {
|
|
||||||
GL11.glEnable(GL11.GL_BLEND)
|
|
||||||
GL11.glColorMask(true, true, true, true)
|
|
||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA)
|
|
||||||
|
|
||||||
var thisCol = color
|
|
||||||
|
|
||||||
// hangul fonts first
|
|
||||||
//hangulSheet.startUse() // disabling texture binding to make the font coloured
|
|
||||||
// JOHAB
|
|
||||||
for (i in 0..s.length - 1) {
|
|
||||||
val ch = s[i]
|
|
||||||
|
|
||||||
if (isHangul(ch)) {
|
|
||||||
val hIndex = ch.toInt() - 0xAC00
|
|
||||||
|
|
||||||
val indexCho = getHanChosung(hIndex)
|
|
||||||
val indexJung = getHanJungseong(hIndex)
|
|
||||||
val indexJong = getHanJongseong(hIndex)
|
|
||||||
|
|
||||||
val choRow = getHanInitialRow(hIndex)
|
|
||||||
val jungRow = getHanMedialRow(hIndex)
|
|
||||||
val jongRow = getHanFinalRow(hIndex)
|
|
||||||
|
|
||||||
val glyphW = getWidth(ch.toString())
|
|
||||||
|
|
||||||
hangulSheet.getSubImage(indexCho, choRow).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
hangulSheet.getSubImage(indexJung, jungRow).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
hangulSheet.getSubImage(indexJong, jongRow).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//hangulSheet.endUse()
|
|
||||||
|
|
||||||
// unihan fonts
|
|
||||||
/*uniHan.startUse();
|
|
||||||
for (int i = 0; i < s.length(); i++) {
|
|
||||||
char ch = s.charAt(i);
|
|
||||||
|
|
||||||
if (isUniHan(ch)) {
|
|
||||||
int glyphW = getWidth("" + ch);
|
|
||||||
uniHan.renderInUse(
|
|
||||||
Math.round(x
|
|
||||||
+ getWidthSubstr(s, i + 1) - glyphW
|
|
||||||
)
|
|
||||||
, Math.round((H - H_UNIHAN) / 2 + y)
|
|
||||||
, uniHanIndexX(ch)
|
|
||||||
, uniHanIndexY(ch)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uniHan.endUse();*/
|
|
||||||
|
|
||||||
// WenQuanYi 1
|
|
||||||
//wenQuanYi_1.startUse()
|
|
||||||
|
|
||||||
for (i in 0..s.length - 1) {
|
|
||||||
val ch = s[i]
|
|
||||||
|
|
||||||
if (isWenQuanYi1(ch)) {
|
|
||||||
val glyphW = getWidth("" + ch)
|
|
||||||
wenQuanYi_1.getSubImage(wenQuanYiIndexX(ch), wenQuanYi1IndexY(ch)).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
Math.round((H - H_UNIHAN) / 2 + y).toFloat(),
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//wenQuanYi_1.endUse()
|
|
||||||
// WenQuanYi 2
|
|
||||||
//wenQuanYi_2.startUse()
|
|
||||||
|
|
||||||
for (i in 0..s.length - 1) {
|
|
||||||
val ch = s[i]
|
|
||||||
|
|
||||||
if (isWenQuanYi2(ch)) {
|
|
||||||
val glyphW = getWidth("" + ch)
|
|
||||||
wenQuanYi_2.getSubImage(wenQuanYiIndexX(ch), wenQuanYi2IndexY(ch)).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
Math.round((H - H_UNIHAN) / 2 + y).toFloat(),
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//wenQuanYi_2.endUse()
|
|
||||||
|
|
||||||
// regular fonts
|
|
||||||
var prevInstance = -1
|
|
||||||
for (i in 0..s.length - 1) {
|
|
||||||
val ch = s[i]
|
|
||||||
|
|
||||||
if (!isHangul(ch) && !isUniHan(ch)) {
|
|
||||||
|
|
||||||
// if not init, endUse first
|
|
||||||
if (prevInstance != -1) {
|
|
||||||
//sheetKey[prevInstance].endUse()
|
|
||||||
}
|
|
||||||
//sheetKey[getSheetType(ch)].startUse()
|
|
||||||
prevInstance = getSheetType(ch)
|
|
||||||
|
|
||||||
val sheetX: Int
|
|
||||||
val sheetY: Int
|
|
||||||
when (prevInstance) {
|
|
||||||
SHEET_EXTA_VARW -> {
|
|
||||||
sheetX = extAindexX(ch)
|
|
||||||
sheetY = extAindexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_KANA -> {
|
|
||||||
sheetX = kanaIndexX(ch)
|
|
||||||
sheetY = kanaIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_CJK_PUNCT -> {
|
|
||||||
sheetX = cjkPunctIndexX(ch)
|
|
||||||
sheetY = cjkPunctIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_CYRILIC_VARW -> {
|
|
||||||
sheetX = cyrilicIndexX(ch)
|
|
||||||
sheetY = cyrilicIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_FW_UNI -> {
|
|
||||||
sheetX = fullwidthUniIndexX(ch)
|
|
||||||
sheetY = fullwidthUniIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_UNI_PUNCT -> {
|
|
||||||
sheetX = uniPunctIndexX(ch)
|
|
||||||
sheetY = uniPunctIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_GREEK_VARW -> {
|
|
||||||
sheetX = greekIndexX(ch)
|
|
||||||
sheetY = greekIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_EXTB_ROMANIAN_WIDE -> {
|
|
||||||
sheetX = romanianIndexX(ch)
|
|
||||||
sheetY = romanianIndexY(ch)
|
|
||||||
}
|
|
||||||
SHEET_EXTB_ROMANIAN_NARROW -> {
|
|
||||||
sheetX = 0
|
|
||||||
sheetY = 0
|
|
||||||
}
|
|
||||||
else -> {
|
|
||||||
sheetX = ch.toInt() % 16
|
|
||||||
sheetY = ch.toInt() / 16
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val glyphW = getWidth("" + ch)
|
|
||||||
try {
|
|
||||||
sheetKey[prevInstance]!!.getSubImage(sheetX, sheetY).drawWithShadow(
|
|
||||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
|
||||||
|
|
||||||
// to deal with the height difference of the sheets
|
|
||||||
Math.round(y).toFloat() + (if (prevInstance == SHEET_CJK_PUNCT) -1 // height hack
|
|
||||||
else if (prevInstance == SHEET_FW_UNI) (H - H_HANGUL) / 2 // completely legit height adjustment
|
|
||||||
else 0).toFloat(),
|
|
||||||
|
|
||||||
scale.toFloat(), thisCol
|
|
||||||
)
|
|
||||||
}
|
|
||||||
catch (e: ArrayIndexOutOfBoundsException) {
|
|
||||||
// character that does not exist in the sheet. No render, pass.
|
|
||||||
}
|
|
||||||
catch (e1: RuntimeException) {
|
|
||||||
// System.err.println("[GameFontBase] RuntimeException raised while processing character '$ch' (U+${Integer.toHexString(ch.toInt()).toUpperCase()})")
|
|
||||||
// e1.printStackTrack()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (prevInstance != -1) {
|
|
||||||
//sheetKey[prevInstance].endUse()
|
|
||||||
}
|
|
||||||
|
|
||||||
GL11.glEnd()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getSheetType(c: Char): Int {
|
|
||||||
// EFs
|
|
||||||
if (isRomanianNarrow(c))
|
|
||||||
return SHEET_EXTB_ROMANIAN_NARROW
|
|
||||||
else if (isHangul(c))
|
|
||||||
return SHEET_HANGUL
|
|
||||||
else if (isKana(c))
|
|
||||||
return SHEET_KANA
|
|
||||||
else if (isUniHan(c))
|
|
||||||
return SHEET_UNIHAN
|
|
||||||
else if (isAscii(c))
|
|
||||||
return SHEET_ASCII_VARW
|
|
||||||
else if (isExtA(c))
|
|
||||||
return SHEET_EXTA_VARW
|
|
||||||
else if (isCyrilic(c))
|
|
||||||
return SHEET_CYRILIC_VARW
|
|
||||||
else if (isUniPunct(c))
|
|
||||||
return SHEET_UNI_PUNCT
|
|
||||||
else if (isCJKPunct(c))
|
|
||||||
return SHEET_CJK_PUNCT
|
|
||||||
else if (isFullwidthUni(c))
|
|
||||||
return SHEET_FW_UNI
|
|
||||||
else if (isGreek(c))
|
|
||||||
return SHEET_GREEK_VARW
|
|
||||||
else if (isRomanian(c))
|
|
||||||
return SHEET_EXTB_ROMANIAN_WIDE
|
|
||||||
else
|
|
||||||
return SHEET_UNKNOWN// fixed width punctuations
|
|
||||||
// fixed width
|
|
||||||
// fallback
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Draw part of a string to the screen. Note that this will still position the text as though
|
|
||||||
* it's part of the bigger string.
|
|
||||||
* @param x
|
|
||||||
* *
|
|
||||||
* @param y
|
|
||||||
* *
|
|
||||||
* @param s
|
|
||||||
* *
|
|
||||||
* @param color
|
|
||||||
* *
|
|
||||||
* @param startIndex
|
|
||||||
* *
|
|
||||||
* @param endIndex
|
|
||||||
*/
|
|
||||||
override fun drawString(x: Float, y: Float, s: String, color: Color, startIndex: Int, endIndex: Int) {
|
|
||||||
val unprintedHead = s.substring(0, startIndex)
|
|
||||||
val printedBody = s.substring(startIndex, endIndex)
|
|
||||||
val xoff = getWidth(unprintedHead)
|
|
||||||
drawString(x + xoff, y, printedBody, color)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun buildWidthTable(sheet: SpriteSheet, codeOffset: Int, codeRange: IntRange, rows: Int = 16) {
|
|
||||||
fun Byte.toUint() = java.lang.Byte.toUnsignedInt(this)
|
|
||||||
|
|
||||||
/** @return Intarray(R, G, B, A) */
|
|
||||||
fun Texture.getPixel(x: Int, y: Int): IntArray {
|
|
||||||
val textureWidth = this.textureWidth
|
|
||||||
val hasAlpha = this.hasAlpha()
|
|
||||||
|
|
||||||
val offset = (if (hasAlpha) 4 else 3) * (textureWidth * y + x) // 4: # of channels (RGBA)
|
|
||||||
|
|
||||||
if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) {
|
|
||||||
return intArrayOf(
|
|
||||||
this.textureData[offset].toUint(),
|
|
||||||
this.textureData[offset + 1].toUint(),
|
|
||||||
this.textureData[offset + 2].toUint(),
|
|
||||||
if (hasAlpha)
|
|
||||||
this.textureData[offset + 3].toUint()
|
|
||||||
else 255
|
|
||||||
)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return intArrayOf(
|
|
||||||
this.textureData[offset + 2].toUint(),
|
|
||||||
this.textureData[offset + 1].toUint(),
|
|
||||||
this.textureData[offset].toUint(),
|
|
||||||
if (hasAlpha)
|
|
||||||
this.textureData[offset + 3].toUint()
|
|
||||||
else 255
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val binaryCodeOffset = 15
|
|
||||||
|
|
||||||
val cellW = sheet.getSubImage(0, 0).width + 1 // should be 16
|
|
||||||
val cellH = sheet.getSubImage(0, 0).height + 1 // should be 20
|
|
||||||
|
|
||||||
// control chars
|
|
||||||
for (ccode in codeRange) {
|
|
||||||
val glyphX = ccode % rows
|
|
||||||
val glyphY = ccode / rows
|
|
||||||
|
|
||||||
val codeStartX = (glyphX * cellW) + binaryCodeOffset
|
|
||||||
val codeStartY = (glyphY * cellH)
|
|
||||||
|
|
||||||
var glyphWidth = 0
|
|
||||||
for (downCtr in 0..3) {
|
|
||||||
// if alpha is not zero, assume it's 1
|
|
||||||
if (sheet.texture.getPixel(codeStartX, codeStartY + downCtr)[3] == 255) {
|
|
||||||
glyphWidth = glyphWidth or (1 shl downCtr)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
asciiWidths[codeOffset + ccode] = glyphWidth
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
|
|
||||||
lateinit internal var hangulSheet: SpriteSheet
|
|
||||||
lateinit internal var asciiSheet: SpriteSheet
|
|
||||||
|
|
||||||
internal val asciiWidths: HashMap<Int, Int> = HashMap()
|
|
||||||
|
|
||||||
lateinit internal var extASheet: SpriteSheet
|
|
||||||
lateinit internal var kanaSheet: SpriteSheet
|
|
||||||
lateinit internal var cjkPunct: SpriteSheet
|
|
||||||
// static SpriteSheet uniHan;
|
|
||||||
lateinit internal var cyrilic: SpriteSheet
|
|
||||||
lateinit internal var fullwidthForms: SpriteSheet
|
|
||||||
lateinit internal var uniPunct: SpriteSheet
|
|
||||||
lateinit internal var wenQuanYi_1: SpriteSheet
|
|
||||||
lateinit internal var wenQuanYi_2: SpriteSheet
|
|
||||||
lateinit internal var greekSheet: SpriteSheet
|
|
||||||
lateinit internal var romanianSheet: SpriteSheet
|
|
||||||
lateinit internal var romanianSheetNarrow: SpriteSheet
|
|
||||||
|
|
||||||
internal val JUNG_COUNT = 21
|
|
||||||
internal val JONG_COUNT = 28
|
|
||||||
|
|
||||||
internal val W_ASIAN_PUNCT = 10
|
|
||||||
internal val W_HANGUL = 11
|
|
||||||
internal val W_KANA = 12
|
|
||||||
internal val W_UNIHAN = 16
|
|
||||||
internal val W_LATIN_WIDE = 9 // width of regular letters, including m
|
|
||||||
internal val W_LATIN_NARROW = 5 // width of letter f, t, i, l
|
|
||||||
|
|
||||||
internal val H = 20
|
|
||||||
internal val H_HANGUL = 16
|
|
||||||
internal val H_UNIHAN = 16
|
|
||||||
internal val H_KANA = 20
|
|
||||||
|
|
||||||
internal val SHEET_ASCII_VARW = 0
|
|
||||||
internal val SHEET_HANGUL = 1
|
|
||||||
internal val SHEET_EXTA_VARW = 2
|
|
||||||
internal val SHEET_KANA = 3
|
|
||||||
internal val SHEET_CJK_PUNCT = 4
|
|
||||||
internal val SHEET_UNIHAN = 5
|
|
||||||
internal val SHEET_CYRILIC_VARW = 6
|
|
||||||
internal val SHEET_FW_UNI = 7
|
|
||||||
internal val SHEET_UNI_PUNCT = 8
|
|
||||||
internal val SHEET_WENQUANYI_1 = 9
|
|
||||||
internal val SHEET_WENQUANYI_2 = 10
|
|
||||||
internal val SHEET_GREEK_VARW = 11
|
|
||||||
internal val SHEET_EXTB_ROMANIAN_WIDE = 12
|
|
||||||
internal val SHEET_EXTB_ROMANIAN_NARROW = 13
|
|
||||||
|
|
||||||
internal val SHEET_UNKNOWN = 254
|
|
||||||
internal val SHEET_COLOURCODE = 255
|
|
||||||
|
|
||||||
lateinit internal var sheetKey: Array<SpriteSheet?>
|
|
||||||
|
|
||||||
internal var interchar = 0
|
|
||||||
internal var scale = 1
|
|
||||||
set(value) {
|
|
||||||
if (value > 0) field = value
|
|
||||||
else throw IllegalArgumentException("Font scale cannot be zero or negative (input: $value)")
|
|
||||||
}
|
|
||||||
|
|
||||||
}// end of companion object
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Image.drawWithShadow(x: Float, y: Float, color: Color) =
|
|
||||||
this.drawWithShadow(x, y, 1f, color)
|
|
||||||
|
|
||||||
fun Image.drawWithShadow(x: Float, y: Float, scale: Float, color: Color) {
|
|
||||||
this.draw(x + 1, y + 1, scale, color.darker(0.5f))
|
|
||||||
this.draw(x , y + 1, scale, color.darker(0.5f))
|
|
||||||
this.draw(x + 1, y , scale, color.darker(0.5f))
|
|
||||||
|
|
||||||
this.draw(x, y, scale, color)
|
|
||||||
}
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
package net.torvald.terrarum.imagefont
|
|
||||||
|
|
||||||
import net.torvald.imagefont.GameFontImpl
|
|
||||||
import org.newdawn.slick.*
|
|
||||||
import java.io.File
|
|
||||||
import java.io.FileInputStream
|
|
||||||
import java.nio.file.FileSystems
|
|
||||||
import java.nio.file.Files
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by SKYHi14 on 2017-02-16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
class GameFontDemo : BasicGame("Terrarum Sans Bitmap Demo") {
|
|
||||||
|
|
||||||
lateinit var gameFont: Font
|
|
||||||
|
|
||||||
override fun init(p0: GameContainer?) {
|
|
||||||
gameFont = GameFontImpl()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun update(gc: GameContainer, delta: Int) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun render(gc: GameContainer, g: Graphics) {
|
|
||||||
g.font = gameFont
|
|
||||||
g.background = Color(0x282828)
|
|
||||||
text.forEachIndexed { i, s ->
|
|
||||||
g.drawString(s, 10f, 10f + i * gameFont.lineHeight)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
lateinit var gameLocale: String
|
|
||||||
var hasError: Boolean
|
|
||||||
val text = ArrayList<String>()
|
|
||||||
|
|
||||||
init {
|
|
||||||
try {
|
|
||||||
val prop = Properties()
|
|
||||||
prop.load(FileInputStream("./config.properties"))
|
|
||||||
|
|
||||||
gameLocale = prop.getProperty("locale")
|
|
||||||
|
|
||||||
if (gameLocale.length < 2)
|
|
||||||
throw IllegalArgumentException("Bad locale setting: “$gameLocale”")
|
|
||||||
|
|
||||||
|
|
||||||
Files.lines(FileSystems.getDefault().getPath("./text.txt")).forEach(
|
|
||||||
{ text.add(it) }
|
|
||||||
)
|
|
||||||
|
|
||||||
hasError = false
|
|
||||||
}
|
|
||||||
catch (e: Exception) {
|
|
||||||
gameLocale = "enUS"
|
|
||||||
hasError = true
|
|
||||||
text.add("There was some problem loading the demo :(")
|
|
||||||
text.add("This is what JVM says:")
|
|
||||||
text.add("")
|
|
||||||
e.message!!.split('\n').forEach {
|
|
||||||
text.add(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
|
||||||
|
|
||||||
System.setProperty("java.library.path", "lib")
|
|
||||||
System.setProperty("org.lwjgl.librarypath", File("lib").absolutePath)
|
|
||||||
|
|
||||||
val WIDTH = 1000
|
|
||||||
val HEIGHT = 800
|
|
||||||
|
|
||||||
try {
|
|
||||||
val appgc = AppGameContainer(GameFontDemo())
|
|
||||||
appgc.setDisplayMode(WIDTH, HEIGHT, false)
|
|
||||||
|
|
||||||
appgc.setMultiSample(0)
|
|
||||||
appgc.setShowFPS(false)
|
|
||||||
|
|
||||||
// game will run normally even if it is not focused
|
|
||||||
appgc.setUpdateOnlyWhenVisible(false)
|
|
||||||
appgc.alwaysRender = true
|
|
||||||
|
|
||||||
appgc.start()
|
|
||||||
}
|
|
||||||
catch (ex: Exception) {
|
|
||||||
ex.printStackTrace()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
package net.torvald.imagefont
|
|
||||||
|
|
||||||
import net.torvald.terrarum.imagefont.GameFontDemo
|
|
||||||
import org.newdawn.slick.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by minjaesong on 16-01-20.
|
|
||||||
*/
|
|
||||||
class GameFontImpl : GameFontBase() {
|
|
||||||
|
|
||||||
init {
|
|
||||||
|
|
||||||
GameFontBase.hangulSheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/hangul_johab.tga", GameFontBase.W_HANGUL, GameFontBase.H_HANGUL)
|
|
||||||
GameFontBase.asciiSheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/ascii_variable.tga", 15, 19, 1)
|
|
||||||
GameFontBase.extASheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/LatinExtA_variable.tga", 15, 19, 1)
|
|
||||||
GameFontBase.kanaSheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/kana.tga", GameFontBase.W_KANA, GameFontBase.H_KANA)
|
|
||||||
GameFontBase.cjkPunct = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/cjkpunct.tga", GameFontBase.W_ASIAN_PUNCT, GameFontBase.H_KANA)
|
|
||||||
/*uniHan = new SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/unifont_unihan"
|
|
||||||
+ ((!terrarum.gameLocale.contains("zh"))
|
|
||||||
? "_ja" : "")
|
|
||||||
+".tga"
|
|
||||||
, W_UNIHAN, H_UNIHAN
|
|
||||||
);*/
|
|
||||||
GameFontBase.cyrilic = SpriteSheet(
|
|
||||||
when (GameFontDemo.gameLocale.substring(0..1)) {
|
|
||||||
"bg" -> "./assets/graphics/fonts/cyrilic_bulgarian_variable.tga"
|
|
||||||
"sr" -> "./assets/graphics/fonts/cyrilic_serbian_variable.tga"
|
|
||||||
else -> "./assets/graphics/fonts/cyrilic_variable.tga"
|
|
||||||
}, 15, 19, 1)
|
|
||||||
GameFontBase.fullwidthForms = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/fullwidth_forms.tga", GameFontBase.W_UNIHAN, GameFontBase.H_UNIHAN)
|
|
||||||
GameFontBase.uniPunct = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/unipunct.tga", GameFontBase.W_LATIN_WIDE, GameFontBase.H)
|
|
||||||
GameFontBase.wenQuanYi_1 = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/wenquanyi_11pt_part1.tga", 16, 18, 2)
|
|
||||||
GameFontBase.wenQuanYi_2 = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/wenquanyi_11pt_part2.tga", 16, 18, 2)
|
|
||||||
GameFontBase.greekSheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/greek_variable.tga", 15, 19, 1)
|
|
||||||
GameFontBase.romanianSheet = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/romana_wide.tga", GameFontBase.W_LATIN_WIDE, GameFontBase.H)
|
|
||||||
GameFontBase.romanianSheetNarrow = SpriteSheet(
|
|
||||||
"./assets/graphics/fonts/romana_narrow.tga", GameFontBase.W_LATIN_NARROW, GameFontBase.H)
|
|
||||||
|
|
||||||
val shk = arrayOf(
|
|
||||||
GameFontBase.asciiSheet,
|
|
||||||
GameFontBase.hangulSheet,
|
|
||||||
GameFontBase.extASheet,
|
|
||||||
GameFontBase.kanaSheet,
|
|
||||||
GameFontBase.cjkPunct,
|
|
||||||
null, // Full unihan, filler because we're using WenQuanYi
|
|
||||||
GameFontBase.cyrilic,
|
|
||||||
GameFontBase.fullwidthForms,
|
|
||||||
GameFontBase.uniPunct,
|
|
||||||
GameFontBase.wenQuanYi_1,
|
|
||||||
GameFontBase.wenQuanYi_2,
|
|
||||||
GameFontBase.greekSheet,
|
|
||||||
GameFontBase.romanianSheet,
|
|
||||||
GameFontBase.romanianSheetNarrow
|
|
||||||
)
|
|
||||||
GameFontBase.sheetKey = shk
|
|
||||||
|
|
||||||
|
|
||||||
buildWidthTable(asciiSheet, 0, 0..0xFF)
|
|
||||||
buildWidthTable(extASheet, 0x100, 0..0x7F)
|
|
||||||
buildWidthTable(cyrilic, 0x400, 0..0x5F)
|
|
||||||
buildWidthTable(greekSheet, 0x370, 0..0x5F)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
Set locale in config.properties to “bgBG” for alternative Bulgarian letters, “srSR” for Serbian.
|
|
||||||
|
|
||||||
ABCDEFGHIJKLM NOPQRSTUVWXYZ
|
|
||||||
abcdefghijklm nopqrstuvwxyz
|
|
||||||
|
|
||||||
Syö salmiakkia, koska se on hyvää sinulle
|
|
||||||
|
|
||||||
The Olympic marmot (Marmota olympus) is a rodent in the squirrel family, Sciuridae.
|
|
||||||
It lives only in the U.S. state of Washington, at middle elevations on the Olympic Peninsula.
|
|
||||||
About the size of a domestic cat, an adult weighs around 8 kg (18 lb) in summer.
|
|
||||||
|
|
||||||
Brná je část statutárního a krajského města Ústí nad Labem v České republice, spadající
|
|
||||||
pod městský obvod Ústí nad Labem-Střekov. Nachází se asi pět kilometrů jižně od centra
|
|
||||||
města v Českém středohoří na pravém břehu řeky Labe.
|
|
||||||
|
|
||||||
Malaysia er en forholdsvis ung stat. Sin endelige udstrækning fik den først i 1965 efter
|
|
||||||
at Singapore trak sig ud. Staten blev grundlagt ved en sammenslutning af flere tidligere
|
|
||||||
britiske besiddelser, foreløbigt i 1957 og endeligt i 1963.
|
|
||||||
|
|
||||||
Το θάλλιο συνοδεύει κυρίως θειούχα ορυκτά βασικών μετάλλων, όπως ο σφαλερίτης, ο σιδηροπυρίτης
|
|
||||||
και ο γαληνίτης ενώ αναφέρονται και εμφανίσεις του σε κονδύλους μαγγανίου στους βυθούς των ωκεανών.
|
|
||||||
διαφυλάξτε γενικά τη ζωή σας από βαθειά ψυχικά τραύματα
|
|
||||||
ΔΙΑΦΥΛΆΞΤΕ ΓΕΝΙΚΆ ΤΗ ΖΩΉ ΣΑΣ ΑΠΌ ΒΑΘΕΙΆ ΨΥΧΙΚΆ ΤΡΑΎΜΑΤΑ
|
|
||||||
Широкая электрификация южных губерний даст мощный толчок подъёму сельского хозяйства.
|
|
||||||
Příliš žluťoučký kůň úpěl ďábelské ódy. Árvíztűrő tükörfúrógép.
|
|
||||||
Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.
|
|
||||||
Pijamalı hasta yağız şoföre çabucak güvendi. Kŕdeľ ďatľov učí koňa žrať kôru.
|
|
||||||
Voix ambiguë d'un cœur qui au zéphyr préfère les jattes de kiwi.
|
|
||||||
Înjurând pițigăiat, zoofobul comandă vexat whisky și tequila.
|
|
||||||
|
|
||||||
sjaldgæft ekki stjórnarskrárvarin
|
|
||||||
|
|
||||||
Also supports:
|
|
||||||
‛Unicode’ „quotation marks“—dashes…‼
|
|
||||||
으웽~. 얘! 위에 이 애 우유의 양 외워와! 아오~ 왜요? 어여! 예... 웬 초콜릿? 제가 원했던 건 뻥튀기 쬐끔과 의류예요. 얘야, 왜 또 불평? 퀡퇣풿횂
|
|
||||||
とりなくこゑす ゆめさませ みよあけわたる ひんかしを そらいろはえて おきつへに ほふねむれゐぬ もやのうち
|
|
||||||
鳥啼く声す 夢覚ませ 見よ明け渡る 東を 空色栄えて 沖つ辺に 帆船群れゐぬ 靄の中,
|
|
||||||
BIN
font_drawing_template.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
font_test_3.PNG
|
Before Width: | Height: | Size: 53 KiB |
BIN
glyph_height_pos_annotation.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
3
samples/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Following is a rendering of various versions of Wikipedia article "x86". The particular article was chosen because it contains good mixture of English and numbers.
|
||||||
|
|
||||||
|

|
||||||
BIN
samples/wikipedia_x86.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
30
src/net/torvald/terrarumsansbitmap/GlyphProps.kt
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package net.torvald.terrarumsansbitmap
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by minjaesong on 2018-08-07.
|
||||||
|
*/
|
||||||
|
data class GlyphProps(
|
||||||
|
val width: Int,
|
||||||
|
val writeOnTop: Boolean,
|
||||||
|
val alignWhere: Int,
|
||||||
|
val alignXPos: Int,
|
||||||
|
val rtl: Boolean = false,
|
||||||
|
val diacriticsStackDown: Boolean = false,
|
||||||
|
val diacriticsBeforeGlyph: Boolean = false
|
||||||
|
) {
|
||||||
|
companion object {
|
||||||
|
const val LEFT = 0
|
||||||
|
const val RIGHT = 1
|
||||||
|
const val CENTRE = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(width: Int, tags: Int) : this(
|
||||||
|
width,
|
||||||
|
tags.ushr(7).and(1) == 1,
|
||||||
|
tags.ushr(5).and(3),
|
||||||
|
tags.ushr(1).and(15),
|
||||||
|
tags.and(1) == 1,
|
||||||
|
tags.ushr(8).and(1) == 1,
|
||||||
|
tags.ushr(5).and(3) == 3
|
||||||
|
)
|
||||||
|
}
|
||||||
1094
src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt
Normal file
82
src/net/torvald/terrarumsansbitmap/gdx/TextureRegionPack.kt
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Terrarum Sans Bitmap
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Minjae Song (Torvald)
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.torvald.terrarumsansbitmap.gdx
|
||||||
|
|
||||||
|
import com.badlogic.gdx.files.FileHandle
|
||||||
|
import com.badlogic.gdx.graphics.Texture
|
||||||
|
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by minjaesong on 2017-06-15.
|
||||||
|
*/
|
||||||
|
class TextureRegionPack(
|
||||||
|
val texture: Texture,
|
||||||
|
val tileW: Int,
|
||||||
|
val tileH: Int,
|
||||||
|
val hGap: Int = 0,
|
||||||
|
val vGap: Int = 0,
|
||||||
|
val hFrame: Int = 0,
|
||||||
|
val vFrame: Int = 0
|
||||||
|
) {
|
||||||
|
|
||||||
|
constructor(ref: String, tileW: Int, tileH: Int, hGap: Int = 0, vGap: Int = 0, hFrame: Int = 0, vFrame: Int = 0) :
|
||||||
|
this(Texture(ref), tileW, tileH, hGap, vGap, hFrame, vFrame)
|
||||||
|
constructor(fileHandle: FileHandle, tileW: Int, tileH: Int, hGap: Int = 0, vGap: Int = 0, hFrame: Int = 0, vFrame: Int = 0) :
|
||||||
|
this(Texture(fileHandle), tileW, tileH, hGap, vGap, hFrame, vFrame)
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
/** Intented for Y-down coord system, typically fon Non-GDX codebase */
|
||||||
|
var globalFlipY = false
|
||||||
|
}
|
||||||
|
|
||||||
|
val regions: Array<TextureRegion>
|
||||||
|
|
||||||
|
val horizontalCount = (texture.width - 2 * hFrame + hGap) / (tileW + hGap)
|
||||||
|
val verticalCount = (texture.height - 2 * vFrame + vGap) / (tileH + vGap)
|
||||||
|
|
||||||
|
init {
|
||||||
|
//println("texture: $texture, dim: ${texture.width} x ${texture.height}, grid: $horizontalCount x $verticalCount, cellDim: $tileW x $tileH")
|
||||||
|
|
||||||
|
regions = Array<TextureRegion>(horizontalCount * verticalCount, {
|
||||||
|
val region = TextureRegion()
|
||||||
|
val rx = (it % horizontalCount * (tileW + hGap)) + hFrame
|
||||||
|
val ry = (it / horizontalCount * (tileH + vGap)) + vFrame
|
||||||
|
|
||||||
|
region.setRegion(texture)
|
||||||
|
region.setRegion(rx, ry, tileW, tileH)
|
||||||
|
|
||||||
|
region.flip(false, globalFlipY)
|
||||||
|
|
||||||
|
/*return*/region
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun get(x: Int, y: Int) = regions[y * horizontalCount + x]
|
||||||
|
|
||||||
|
fun dispose() {
|
||||||
|
texture.dispose()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
1
src/net/torvald/terrarumsansbitmap/readme.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
This directory contains implementation of the font in various frameworks.
|
||||||
790
src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt
Normal file
@@ -0,0 +1,790 @@
|
|||||||
|
/*
|
||||||
|
* Terrarum Sans Bitmap
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Minjae Song (Torvald)
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.torvald.terrarumsansbitmap.slick2d
|
||||||
|
|
||||||
|
/*import net.torvald.terrarumsansbitmap.gdx.GameFontBase
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.JUNG_COUNT
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.JONG_COUNT
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.W_ASIAN_PUNCT
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.W_HANGUL
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.W_KANA
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.W_UNIHAN
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.W_LATIN_WIDE
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.W_VAR_INIT
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.HGAP_VAR
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.H
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.H_UNIHAN
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SIZE_CUSTOM_SYM
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_ASCII_VARW
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_HANGUL
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_EXTA_VARW
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_EXTB_VARW
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_KANA
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_CJK_PUNCT
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_UNIHAN
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_CYRILIC_VARW
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_FW_UNI
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_UNI_PUNCT_VARW
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_GREEK_VARW
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_THAI_VARW
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_HAYEREN_VARW
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_KARTULI_VARW
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_IPA_VARW
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_CUSTOM_SYM
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_UNKNOWN
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_RUNIC
|
||||||
|
import net.torvald.terrarumsansbitmap.gdx.GameFontBase.Companion.SHEET_LATIN_EXT_ADD_VARW
|
||||||
|
import org.newdawn.slick.Color
|
||||||
|
import org.newdawn.slick.Font
|
||||||
|
import org.newdawn.slick.Image
|
||||||
|
import org.newdawn.slick.SpriteSheet
|
||||||
|
import org.newdawn.slick.opengl.Texture
|
||||||
|
import java.io.BufferedOutputStream
|
||||||
|
import java.io.File
|
||||||
|
import java.io.FileInputStream
|
||||||
|
import java.io.FileOutputStream
|
||||||
|
import java.util.*
|
||||||
|
import java.util.zip.GZIPInputStream
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LibGDX->Slick2D back-port of Terrarum Sans Bitmap implementation
|
||||||
|
*
|
||||||
|
* Filename and Extension for the spritesheet is hard-coded, which are:
|
||||||
|
*
|
||||||
|
* - ascii_variable.tga
|
||||||
|
* - hangul_johab.tga
|
||||||
|
* - LatinExtA_variable.tga
|
||||||
|
* - LatinExtB_variable.tga
|
||||||
|
* - kana.tga
|
||||||
|
* - cjkpunct.tga
|
||||||
|
* - wenquanyi.tga.gz
|
||||||
|
* - cyrillic_variable.tga
|
||||||
|
* - fullwidth_forms.tga
|
||||||
|
* - unipunct_variable.tga
|
||||||
|
* - greek_variable.tga
|
||||||
|
* - thai_variable.tga
|
||||||
|
* - puae000-e0ff.tga
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Glyphs are drawn lazily (calculated on-the-fly, rather than load up all), which is inevitable as we just can't load
|
||||||
|
* up 40k+ characters on the machine, which will certainly make loading time painfully long.
|
||||||
|
*
|
||||||
|
* Color Codes have following Unicode mapping: U+10RGBA, A must be non-zero to be visible. U+100000 reverts any colour code effects.
|
||||||
|
*
|
||||||
|
* @param noShadow Self-explanatory
|
||||||
|
* @param flipY If you have Y-down coord system implemented on your GDX (e.g. legacy codebase), set this to ```true``` so that the shadow won't be upside-down. For glyph getting upside-down, set ```TextureRegionPack.globalFlipY = true```.
|
||||||
|
*
|
||||||
|
* Created by minjaesong on 2017-06-15.
|
||||||
|
*/
|
||||||
|
class GameFontBase(fontDir: String, val noShadow: Boolean = false) : Font {
|
||||||
|
|
||||||
|
private fun getHanChosung(hanIndex: Int) = hanIndex / (JUNG_COUNT * JONG_COUNT)
|
||||||
|
private fun getHanJungseong(hanIndex: Int) = hanIndex / JONG_COUNT % JUNG_COUNT
|
||||||
|
private fun getHanJongseong(hanIndex: Int) = hanIndex % JONG_COUNT
|
||||||
|
|
||||||
|
private val jungseongWide = arrayOf(8, 12, 13, 17, 18, 21)
|
||||||
|
private val jungseongComplex = arrayOf(9, 10, 11, 14, 15, 16, 22)
|
||||||
|
|
||||||
|
private fun isJungseongWide(hanIndex: Int) = jungseongWide.contains(getHanJungseong(hanIndex))
|
||||||
|
private fun isJungseongComplex(hanIndex: Int) = jungseongComplex.contains(getHanJungseong(hanIndex))
|
||||||
|
|
||||||
|
private fun getHanInitialRow(hanIndex: Int): Int {
|
||||||
|
val ret: Int
|
||||||
|
|
||||||
|
if (isJungseongWide(hanIndex))
|
||||||
|
ret = 2
|
||||||
|
else if (isJungseongComplex(hanIndex))
|
||||||
|
ret = 4
|
||||||
|
else
|
||||||
|
ret = 0
|
||||||
|
|
||||||
|
return if (getHanJongseong(hanIndex) == 0) ret else ret + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getHanMedialRow(hanIndex: Int) = if (getHanJongseong(hanIndex) == 0) 6 else 7
|
||||||
|
|
||||||
|
private fun getHanFinalRow(hanIndex: Int): Int {
|
||||||
|
val jungseongIndex = getHanJungseong(hanIndex)
|
||||||
|
|
||||||
|
return if (jungseongWide.contains(jungseongIndex))
|
||||||
|
8
|
||||||
|
else
|
||||||
|
9
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun isHangul(c: Char) = c.toInt() in codeRange[SHEET_HANGUL]
|
||||||
|
private fun isAscii(c: Char) = c.toInt() in codeRange[SHEET_ASCII_VARW]
|
||||||
|
private fun isRunic(c: Char) = c.toInt() in codeRange[SHEET_RUNIC]
|
||||||
|
private fun isExtA(c: Char) = c.toInt() in codeRange[SHEET_EXTA_VARW]
|
||||||
|
private fun isExtB(c: Char) = c.toInt() in codeRange[SHEET_EXTB_VARW]
|
||||||
|
private fun isKana(c: Char) = c.toInt() in codeRange[SHEET_KANA]
|
||||||
|
private fun isCJKPunct(c: Char) = c.toInt() in codeRange[SHEET_CJK_PUNCT]
|
||||||
|
private fun isUniHan(c: Char) = c.toInt() in codeRange[SHEET_UNIHAN]
|
||||||
|
private fun isCyrilic(c: Char) = c.toInt() in codeRange[SHEET_CYRILIC_VARW]
|
||||||
|
private fun isFullwidthUni(c: Char) = c.toInt() in codeRange[SHEET_FW_UNI]
|
||||||
|
private fun isUniPunct(c: Char) = c.toInt() in codeRange[SHEET_UNI_PUNCT_VARW]
|
||||||
|
private fun isGreek(c: Char) = c.toInt() in codeRange[SHEET_GREEK_VARW]
|
||||||
|
private fun isThai(c: Char) = c.toInt() in codeRange[SHEET_THAI_VARW]
|
||||||
|
private fun isDiacritics(c: Char) = c.toInt() in 0xE34..0xE3A
|
||||||
|
|| c.toInt() in 0xE47..0xE4E
|
||||||
|
|| c.toInt() == 0xE31
|
||||||
|
private fun isCustomSym(c: Char) = c.toInt() in codeRange[SHEET_CUSTOM_SYM]
|
||||||
|
private fun isArmenian(c: Char) = c.toInt() in codeRange[SHEET_HAYEREN_VARW]
|
||||||
|
private fun isKartvelian(c: Char) = c.toInt() in codeRange[SHEET_KARTULI_VARW]
|
||||||
|
private fun isIPA(c: Char) = c.toInt() in codeRange[SHEET_IPA_VARW]
|
||||||
|
private fun isColourCodeHigh(c: Char) = c.toInt() in 0b110110_1111000000..0b110110_1111111111 // only works with JVM (which uses UTF-16 internally)
|
||||||
|
private fun isColourCodeLow(c: Char) = c.toInt() in 0b110111_0000000000..0b110111_1111111111 // only works with JVM (which uses UTF-16 internally)
|
||||||
|
private fun isLatinExtAdd(c: Char) = c.toInt() in 0x1E00..0x1EFF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private fun extAindexX(c: Char) = (c.toInt() - 0x100) % 16
|
||||||
|
private fun extAindexY(c: Char) = (c.toInt() - 0x100) / 16
|
||||||
|
|
||||||
|
private fun extBindexX(c: Char) = (c.toInt() - 0x180) % 16
|
||||||
|
private fun extBindexY(c: Char) = (c.toInt() - 0x180) / 16
|
||||||
|
|
||||||
|
private fun runicIndexX(c: Char) = (c.toInt() - 0x16A0) % 16
|
||||||
|
private fun runicIndexY(c: Char) = (c.toInt() - 0x16A0) / 16
|
||||||
|
|
||||||
|
private fun kanaIndexX(c: Char) = (c.toInt() - 0x3040) % 16
|
||||||
|
private fun kanaIndexY(c: Char) = (c.toInt() - 0x3040) / 16
|
||||||
|
|
||||||
|
private fun cjkPunctIndexX(c: Char) = (c.toInt() - 0x3000) % 16
|
||||||
|
private fun cjkPunctIndexY(c: Char) = (c.toInt() - 0x3000) / 16
|
||||||
|
|
||||||
|
private fun cyrilicIndexX(c: Char) = (c.toInt() - 0x400) % 16
|
||||||
|
private fun cyrilicIndexY(c: Char) = (c.toInt() - 0x400) / 16
|
||||||
|
|
||||||
|
private fun fullwidthUniIndexX(c: Char) = (c.toInt() - 0xFF00) % 16
|
||||||
|
private fun fullwidthUniIndexY(c: Char) = (c.toInt() - 0xFF00) / 16
|
||||||
|
|
||||||
|
private fun uniPunctIndexX(c: Char) = (c.toInt() - 0x2000) % 16
|
||||||
|
private fun uniPunctIndexY(c: Char) = (c.toInt() - 0x2000) / 16
|
||||||
|
|
||||||
|
private fun unihanIndexX(c: Char) = (c.toInt() - 0x3400) % 256
|
||||||
|
private fun unihanIndexY(c: Char) = (c.toInt() - 0x3400) / 256
|
||||||
|
|
||||||
|
private fun greekIndexX(c: Char) = (c.toInt() - 0x370) % 16
|
||||||
|
private fun greekIndexY(c: Char) = (c.toInt() - 0x370) / 16
|
||||||
|
|
||||||
|
private fun thaiIndexX(c: Char) = (c.toInt() - 0xE00) % 16
|
||||||
|
private fun thaiIndexY(c: Char) = (c.toInt() - 0xE00) / 16
|
||||||
|
|
||||||
|
private fun symbolIndexX(c: Char) = (c.toInt() - 0xE000) % 16
|
||||||
|
private fun symbolIndexY(c: Char) = (c.toInt() - 0xE000) / 16
|
||||||
|
|
||||||
|
private fun armenianIndexX(c: Char) = (c.toInt() - 0x530) % 16
|
||||||
|
private fun armenianIndexY(c: Char) = (c.toInt() - 0x530) / 16
|
||||||
|
|
||||||
|
private fun kartvelianIndexX(c: Char) = (c.toInt() - 0x10D0) % 16
|
||||||
|
private fun kartvelianIndexY(c: Char) = (c.toInt() - 0x10D0) / 16
|
||||||
|
|
||||||
|
private fun ipaIndexX(c: Char) = (c.toInt() - 0x250) % 16
|
||||||
|
private fun ipaIndexY(c: Char) = (c.toInt() - 0x250) / 16
|
||||||
|
|
||||||
|
private fun latinExtAddX(c: Char) = (c.toInt() - 0x1E00) % 16
|
||||||
|
private fun latinExtAddY(c: Char) = (c.toInt() - 0x1E00) / 16
|
||||||
|
|
||||||
|
private fun getColour(charHigh: Char, charLow: Char): Color { // input: 0x10ARGB, out: RGBA8888
|
||||||
|
val codePoint = Character.toCodePoint(charHigh, charLow)
|
||||||
|
|
||||||
|
if (colourBuffer.containsKey(codePoint))
|
||||||
|
return colourBuffer[codePoint]!!
|
||||||
|
|
||||||
|
val r = codePoint.and(0xF000).ushr(12)
|
||||||
|
val g = codePoint.and(0x0F00).ushr(8)
|
||||||
|
val b = codePoint.and(0x00F0).ushr(4)
|
||||||
|
val a = codePoint.and(0x000F)
|
||||||
|
|
||||||
|
val col = Color(a.shl(28) or a.shl(24) or r.shl(20) or r.shl(16) or g.shl(12) or g.shl(8) or b.shl(4) or b)
|
||||||
|
|
||||||
|
|
||||||
|
colourBuffer[codePoint] = col
|
||||||
|
return col
|
||||||
|
}
|
||||||
|
|
||||||
|
private val colourBuffer = HashMap<Int, Color>()
|
||||||
|
|
||||||
|
private val unihanWidthSheets = arrayOf(
|
||||||
|
SHEET_UNIHAN,
|
||||||
|
SHEET_FW_UNI
|
||||||
|
)
|
||||||
|
private val variableWidthSheets = arrayOf(
|
||||||
|
SHEET_ASCII_VARW,
|
||||||
|
SHEET_EXTA_VARW,
|
||||||
|
SHEET_EXTB_VARW,
|
||||||
|
SHEET_CYRILIC_VARW,
|
||||||
|
SHEET_UNI_PUNCT_VARW,
|
||||||
|
SHEET_GREEK_VARW,
|
||||||
|
SHEET_THAI_VARW,
|
||||||
|
SHEET_HAYEREN_VARW,
|
||||||
|
SHEET_KARTULI_VARW,
|
||||||
|
SHEET_IPA_VARW,
|
||||||
|
SHEET_LATIN_EXT_ADD_VARW
|
||||||
|
)
|
||||||
|
|
||||||
|
private val fontParentDir = if (fontDir.endsWith('/') || fontDir.endsWith('\\')) fontDir else "$fontDir/"
|
||||||
|
private val fileList = arrayOf( // MUST BE MATCHING WITH SHEET INDICES!!
|
||||||
|
"ascii_variable.tga",
|
||||||
|
"hangul_johab.tga",
|
||||||
|
"latinExtA_variable.tga",
|
||||||
|
"latinExtB_variable.tga",
|
||||||
|
"kana.tga",
|
||||||
|
"cjkpunct.tga",
|
||||||
|
"wenquanyi.tga.gz",
|
||||||
|
"cyrilic_variable.tga",
|
||||||
|
"fullwidth_forms.tga",
|
||||||
|
"unipunct_variable.tga",
|
||||||
|
"greek_variable.tga",
|
||||||
|
"thai_variable.tga",
|
||||||
|
"hayeren_variable.tga",
|
||||||
|
"kartuli_variable.tga",
|
||||||
|
"ipa_ext_variable.tga",
|
||||||
|
"futhark.tga",
|
||||||
|
"latinExt_additional_variable.tga",
|
||||||
|
"puae000-e0ff.tga"
|
||||||
|
)
|
||||||
|
private val cyrilic_bg = "cyrilic_bulgarian_variable.tga"
|
||||||
|
private val cyrilic_sr = "cyrilic_serbian_variable.tga"
|
||||||
|
private val codeRange = arrayOf( // MUST BE MATCHING WITH SHEET INDICES!!
|
||||||
|
0..0xFF,
|
||||||
|
0xAC00..0xD7A3,
|
||||||
|
0x100..0x17F,
|
||||||
|
0x180..0x24F,
|
||||||
|
0x3040..0x30FF,
|
||||||
|
0x3000..0x303F,
|
||||||
|
0x3400..0x9FFF,
|
||||||
|
0x400..0x52F,
|
||||||
|
0xFF00..0xFF1F,
|
||||||
|
0x2000..0x205F,
|
||||||
|
0x370..0x3CE,
|
||||||
|
0xE00..0xE5F,
|
||||||
|
0x530..0x58F,
|
||||||
|
0x10D0..0x10FF,
|
||||||
|
0x250..0x2AF,
|
||||||
|
0x16A0..0x16FF,
|
||||||
|
0x1E00..0x1EFF,
|
||||||
|
0xE000..0xE0FF
|
||||||
|
)
|
||||||
|
private val glyphWidths: HashMap<Int, Int> = HashMap() // if the value is negative, it's diacritics
|
||||||
|
private val sheets: Array<SpriteSheet>
|
||||||
|
|
||||||
|
|
||||||
|
init {
|
||||||
|
val sheetsPack = ArrayList<SpriteSheet>()
|
||||||
|
|
||||||
|
// first we create pixmap to read pixels, then make texture using pixmap
|
||||||
|
fileList.forEachIndexed { index, it ->
|
||||||
|
val isVariable1 = it.endsWith("_variable.tga")
|
||||||
|
val isVariable2 = variableWidthSheets.contains(index)
|
||||||
|
val isVariable = isVariable1 && isVariable2
|
||||||
|
|
||||||
|
// idiocity check
|
||||||
|
if (isVariable1 && !isVariable2)
|
||||||
|
throw Error("[TerrarumSansBitmap] font is named as variable on the name but not enlisted as")
|
||||||
|
else if (!isVariable1 && isVariable2)
|
||||||
|
throw Error("[TerrarumSansBitmap] font is enlisted as variable on the name but not named as")
|
||||||
|
|
||||||
|
|
||||||
|
val image: Image
|
||||||
|
|
||||||
|
|
||||||
|
// unpack gz if applicable
|
||||||
|
if (it.endsWith(".gz")) {
|
||||||
|
val gzi = GZIPInputStream(FileInputStream(fontParentDir + it))
|
||||||
|
val wholeFile = gzi.readBytes()
|
||||||
|
gzi.close()
|
||||||
|
val fos = BufferedOutputStream(FileOutputStream("tmp_wenquanyi.tga"))
|
||||||
|
fos.write(wholeFile)
|
||||||
|
fos.flush()
|
||||||
|
fos.close()
|
||||||
|
|
||||||
|
image = Image("tmp_wenquanyi.tga")
|
||||||
|
|
||||||
|
File("tmp_wenquanyi.tga").delete()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
image = Image(fontParentDir + it)
|
||||||
|
}
|
||||||
|
|
||||||
|
val texture = image.texture
|
||||||
|
|
||||||
|
if (isVariable) {
|
||||||
|
println("[TerrarumSansBitmap] loading texture $it [VARIABLE]")
|
||||||
|
buildWidthTable(texture, codeRange[index], 16)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
println("[TerrarumSansBitmap] loading texture $it")
|
||||||
|
}
|
||||||
|
|
||||||
|
val texRegPack = if (isVariable) {
|
||||||
|
SpriteSheet(image, W_VAR_INIT, H - 1, HGAP_VAR)
|
||||||
|
}
|
||||||
|
else if (index == SHEET_UNIHAN) {
|
||||||
|
SpriteSheet(image, W_UNIHAN, H_UNIHAN) // the only exception that is height is 16
|
||||||
|
}
|
||||||
|
// below they all have height of 20 'H'
|
||||||
|
else if (index == SHEET_FW_UNI) {
|
||||||
|
SpriteSheet(image, W_UNIHAN, H)
|
||||||
|
}
|
||||||
|
else if (index == SHEET_CJK_PUNCT) {
|
||||||
|
SpriteSheet(image, W_ASIAN_PUNCT, H)
|
||||||
|
}
|
||||||
|
else if (index == SHEET_KANA) {
|
||||||
|
SpriteSheet(image, W_KANA, H)
|
||||||
|
}
|
||||||
|
else if (index == SHEET_HANGUL) {
|
||||||
|
SpriteSheet(image, W_HANGUL, H)
|
||||||
|
}
|
||||||
|
else if (index == SHEET_CUSTOM_SYM) {
|
||||||
|
SpriteSheet(image, SIZE_CUSTOM_SYM, SIZE_CUSTOM_SYM) // TODO variable
|
||||||
|
}
|
||||||
|
else if (index == SHEET_RUNIC) {
|
||||||
|
SpriteSheet(image, W_LATIN_WIDE, H)
|
||||||
|
}
|
||||||
|
else throw IllegalArgumentException("[TerrarumSansBitmap] Unknown sheet index: $index")
|
||||||
|
|
||||||
|
|
||||||
|
sheetsPack.add(texRegPack)
|
||||||
|
}
|
||||||
|
|
||||||
|
sheets = sheetsPack.toTypedArray()
|
||||||
|
}
|
||||||
|
|
||||||
|
private var localeBuffer = ""
|
||||||
|
|
||||||
|
fun reload(locale: String) {
|
||||||
|
if (!localeBuffer.startsWith("ru") && locale.startsWith("ru")) {
|
||||||
|
val image = Image(fontParentDir + fileList[SHEET_CYRILIC_VARW])
|
||||||
|
sheets[SHEET_CYRILIC_VARW].destroy()
|
||||||
|
sheets[SHEET_CYRILIC_VARW] = SpriteSheet(image, W_VAR_INIT, H, HGAP_VAR, 0)
|
||||||
|
}
|
||||||
|
else if (!localeBuffer.startsWith("bg") && locale.startsWith("bg")) {
|
||||||
|
val image = Image(fontParentDir + cyrilic_bg)
|
||||||
|
sheets[SHEET_CYRILIC_VARW].destroy()
|
||||||
|
sheets[SHEET_CYRILIC_VARW] = SpriteSheet(image, W_VAR_INIT, H, HGAP_VAR, 0)
|
||||||
|
}
|
||||||
|
else if (!localeBuffer.startsWith("sr") && locale.startsWith("sr")) {
|
||||||
|
val image = Image(fontParentDir + cyrilic_sr)
|
||||||
|
sheets[SHEET_CYRILIC_VARW].destroy()
|
||||||
|
sheets[SHEET_CYRILIC_VARW] = SpriteSheet(image, W_VAR_INIT, H, HGAP_VAR, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
localeBuffer = locale
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getLineHeight(): Int = H
|
||||||
|
override fun getHeight(p0: String) = lineHeight
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private val offsetUnihan = (H - H_UNIHAN) / 2
|
||||||
|
private val offsetCustomSym = (H - SIZE_CUSTOM_SYM) / 2
|
||||||
|
|
||||||
|
private var textBuffer: CharSequence = ""
|
||||||
|
private var textBWidth = intArrayOf() // absolute posX of glyphs from print-origin
|
||||||
|
private var textBGSize = intArrayOf() // width of each glyph
|
||||||
|
|
||||||
|
override fun drawString(x: Float, y: Float, str: String) {
|
||||||
|
drawString(x, y, str, Color.white)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun drawString(p0: Float, p1: Float, p2: String?, p3: Color?, p4: Int, p5: Int) {
|
||||||
|
throw UnsupportedOperationException()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun drawString(x: Float, y: Float, str: String, color: Color) {
|
||||||
|
// always draw at integer position; this is bitmap font after all
|
||||||
|
val x = Math.round(x).toFloat()
|
||||||
|
val y = Math.round(y).toFloat()
|
||||||
|
|
||||||
|
|
||||||
|
if (textBuffer != str) {
|
||||||
|
textBuffer = str
|
||||||
|
val widths = getWidthOfCharSeq(str)
|
||||||
|
|
||||||
|
textBGSize = widths
|
||||||
|
|
||||||
|
textBWidth = IntArray(str.length, { charIndex ->
|
||||||
|
if (charIndex == 0)
|
||||||
|
0
|
||||||
|
else {
|
||||||
|
var acc = 0
|
||||||
|
(0..charIndex - 1).forEach { acc += maxOf(0, widths[it]) } // don't accumulate diacrtics (which has negative value)
|
||||||
|
/*return*/acc
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//print("[TerrarumSansBitmap] widthTable for $textBuffer: ")
|
||||||
|
//textBWidth.forEach { print("$it ") }; println()
|
||||||
|
|
||||||
|
|
||||||
|
var mainCol = color
|
||||||
|
var shadowCol = color.darker(0.5f)
|
||||||
|
|
||||||
|
|
||||||
|
var index = 0
|
||||||
|
while (index <= textBuffer.lastIndex) {
|
||||||
|
val c = textBuffer[index]
|
||||||
|
val sheetID = getSheetType(c)
|
||||||
|
val sheetXY = getSheetwisePosition(c)
|
||||||
|
|
||||||
|
//println("[TerrarumSansBitmap] sprite: $sheetID:${sheetXY[0]}x${sheetXY[1]}")
|
||||||
|
|
||||||
|
if (isColourCodeHigh(c)) {
|
||||||
|
val cchigh = c
|
||||||
|
val cclow = textBuffer[index + 1]
|
||||||
|
|
||||||
|
if (Character.toCodePoint(cchigh, cclow) == 0x100000) {
|
||||||
|
mainCol = color
|
||||||
|
shadowCol = color.darker(0.5f)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mainCol = getColour(cchigh, cclow)
|
||||||
|
shadowCol = mainCol.darker(0.5f)
|
||||||
|
}
|
||||||
|
|
||||||
|
index += 1
|
||||||
|
}
|
||||||
|
else if (isColourCodeLow(c)) {
|
||||||
|
throw Error("Unexpected encounter of ColourCodeLow at index $index of String '$textBuffer'")
|
||||||
|
}
|
||||||
|
else if (sheetID == SHEET_HANGUL) {
|
||||||
|
val hangulSheet = sheets[SHEET_HANGUL]
|
||||||
|
val hIndex = c.toInt() - 0xAC00
|
||||||
|
|
||||||
|
val indexCho = getHanChosung(hIndex)
|
||||||
|
val indexJung = getHanJungseong(hIndex)
|
||||||
|
val indexJong = getHanJongseong(hIndex)
|
||||||
|
|
||||||
|
val choRow = getHanInitialRow(hIndex)
|
||||||
|
val jungRow = getHanMedialRow(hIndex)
|
||||||
|
val jongRow = getHanFinalRow(hIndex)
|
||||||
|
|
||||||
|
|
||||||
|
if (!noShadow) {
|
||||||
|
hangulSheet.getSubImage(indexCho, choRow ).draw(x + textBWidth[index] + 1, y, shadowCol)
|
||||||
|
hangulSheet.getSubImage(indexCho, choRow ).draw(x + textBWidth[index] , y, shadowCol)
|
||||||
|
hangulSheet.getSubImage(indexCho, choRow ).draw(x + textBWidth[index] + 1, y, shadowCol)
|
||||||
|
|
||||||
|
hangulSheet.getSubImage(indexJung, jungRow).draw(x + textBWidth[index] + 1, y, shadowCol)
|
||||||
|
hangulSheet.getSubImage(indexJung, jungRow).draw(x + textBWidth[index] , y, shadowCol)
|
||||||
|
hangulSheet.getSubImage(indexJung, jungRow).draw(x + textBWidth[index] + 1, y, shadowCol)
|
||||||
|
|
||||||
|
hangulSheet.getSubImage(indexJong, jongRow).draw(x + textBWidth[index] + 1, y, shadowCol)
|
||||||
|
hangulSheet.getSubImage(indexJong, jongRow).draw(x + textBWidth[index] , y, shadowCol)
|
||||||
|
hangulSheet.getSubImage(indexJong, jongRow).draw(x + textBWidth[index] + 1, y, shadowCol)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
hangulSheet.getSubImage(indexCho, choRow ).draw(x + textBWidth[index], y, mainCol)
|
||||||
|
hangulSheet.getSubImage(indexJung, jungRow).draw(x + textBWidth[index], y, mainCol)
|
||||||
|
hangulSheet.getSubImage(indexJong, jongRow).draw(x + textBWidth[index], y, mainCol)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
try {
|
||||||
|
val offset = if (!isDiacritics(c)) 0 else {
|
||||||
|
if (index > 0) // LIMITATION: does not support double (or more) diacritics properly
|
||||||
|
(textBGSize[index] - textBGSize[index - 1]) / 2
|
||||||
|
else
|
||||||
|
textBGSize[index]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!noShadow) {
|
||||||
|
sheets[sheetID].getSubImage(sheetXY[0], sheetXY[1]).draw(
|
||||||
|
x + textBWidth[index] + 1 + offset,
|
||||||
|
y + (if (sheetID == SHEET_UNIHAN) // evil exceptions
|
||||||
|
offsetUnihan
|
||||||
|
else if (sheetID == SHEET_CUSTOM_SYM)
|
||||||
|
offsetCustomSym
|
||||||
|
else
|
||||||
|
0),
|
||||||
|
shadowCol
|
||||||
|
)
|
||||||
|
sheets[sheetID].getSubImage(sheetXY[0], sheetXY[1]).draw(
|
||||||
|
x + textBWidth[index] + offset,
|
||||||
|
y + (if (sheetID == SHEET_UNIHAN) // evil exceptions
|
||||||
|
offsetUnihan + 1
|
||||||
|
else if (sheetID == SHEET_CUSTOM_SYM)
|
||||||
|
offsetCustomSym + 1
|
||||||
|
else
|
||||||
|
1),
|
||||||
|
shadowCol
|
||||||
|
)
|
||||||
|
sheets[sheetID].getSubImage(sheetXY[0], sheetXY[1]).draw(
|
||||||
|
x + textBWidth[index] + 1 + offset,
|
||||||
|
y + (if (sheetID == SHEET_UNIHAN) // evil exceptions
|
||||||
|
offsetUnihan + 1
|
||||||
|
else if (sheetID == SHEET_CUSTOM_SYM)
|
||||||
|
offsetCustomSym + 1
|
||||||
|
else
|
||||||
|
1),
|
||||||
|
shadowCol
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sheets[sheetID].getSubImage(sheetXY[0], sheetXY[1]).draw(
|
||||||
|
x + textBWidth[index] + offset,
|
||||||
|
y + if (sheetID == SHEET_UNIHAN) // evil exceptions
|
||||||
|
offsetUnihan
|
||||||
|
else if (sheetID == SHEET_CUSTOM_SYM)
|
||||||
|
offsetCustomSym
|
||||||
|
else 0,
|
||||||
|
mainCol
|
||||||
|
)
|
||||||
|
}
|
||||||
|
catch (noSuchGlyph: ArrayIndexOutOfBoundsException) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
index += 1
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun dispose() {
|
||||||
|
sheets.forEach { it.destroy() }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getWidthOfCharSeq(s: CharSequence): IntArray {
|
||||||
|
val len = IntArray(s.length)
|
||||||
|
for (i in 0..s.lastIndex) {
|
||||||
|
val chr = s[i]
|
||||||
|
val ctype = getSheetType(s[i])
|
||||||
|
|
||||||
|
if (variableWidthSheets.contains(ctype)) {
|
||||||
|
if (!glyphWidths.containsKey(chr.toInt())) {
|
||||||
|
println("[TerrarumSansBitmap] no width data for glyph number ${Integer.toHexString(chr.toInt()).toUpperCase()}")
|
||||||
|
len[i] = W_LATIN_WIDE
|
||||||
|
}
|
||||||
|
|
||||||
|
len[i] = glyphWidths[chr.toInt()]!!
|
||||||
|
}
|
||||||
|
else if (isColourCodeHigh(chr) || isColourCodeLow(chr))
|
||||||
|
len[i] = 0
|
||||||
|
else if (ctype == SHEET_CJK_PUNCT)
|
||||||
|
len[i] = W_ASIAN_PUNCT
|
||||||
|
else if (ctype == SHEET_HANGUL)
|
||||||
|
len[i] = W_HANGUL
|
||||||
|
else if (ctype == SHEET_KANA)
|
||||||
|
len[i] = W_KANA
|
||||||
|
else if (unihanWidthSheets.contains(ctype))
|
||||||
|
len[i] = W_UNIHAN
|
||||||
|
else if (ctype == SHEET_CUSTOM_SYM)
|
||||||
|
len[i] = SIZE_CUSTOM_SYM
|
||||||
|
else
|
||||||
|
len[i] = W_LATIN_WIDE
|
||||||
|
|
||||||
|
if (scale > 1) len[i] *= scale
|
||||||
|
|
||||||
|
if (i < s.lastIndex) len[i] += interchar
|
||||||
|
}
|
||||||
|
return len
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getSheetType(c: Char): Int {
|
||||||
|
if (isHangul(c))
|
||||||
|
return SHEET_HANGUL
|
||||||
|
else if (isKana(c))
|
||||||
|
return SHEET_KANA
|
||||||
|
else if (isUniHan(c))
|
||||||
|
return SHEET_UNIHAN
|
||||||
|
else if (isAscii(c))
|
||||||
|
return SHEET_ASCII_VARW
|
||||||
|
else if (isExtA(c))
|
||||||
|
return SHEET_EXTA_VARW
|
||||||
|
else if (isExtB(c))
|
||||||
|
return SHEET_EXTB_VARW
|
||||||
|
else if (isCyrilic(c))
|
||||||
|
return SHEET_CYRILIC_VARW
|
||||||
|
else if (isUniPunct(c))
|
||||||
|
return SHEET_UNI_PUNCT_VARW
|
||||||
|
else if (isCJKPunct(c))
|
||||||
|
return SHEET_CJK_PUNCT
|
||||||
|
else if (isFullwidthUni(c))
|
||||||
|
return SHEET_FW_UNI
|
||||||
|
else if (isGreek(c))
|
||||||
|
return SHEET_GREEK_VARW
|
||||||
|
else if (isThai(c))
|
||||||
|
return SHEET_THAI_VARW
|
||||||
|
else if (isCustomSym(c))
|
||||||
|
return SHEET_CUSTOM_SYM
|
||||||
|
else if (isArmenian(c))
|
||||||
|
return SHEET_HAYEREN_VARW
|
||||||
|
else if (isKartvelian(c))
|
||||||
|
return SHEET_KARTULI_VARW
|
||||||
|
else if (isIPA(c))
|
||||||
|
return SHEET_IPA_VARW
|
||||||
|
else if (isRunic(c))
|
||||||
|
return SHEET_RUNIC
|
||||||
|
else if (isLatinExtAdd(c))
|
||||||
|
return SHEET_LATIN_EXT_ADD_VARW
|
||||||
|
else
|
||||||
|
return SHEET_UNKNOWN
|
||||||
|
// fixed width
|
||||||
|
// fallback
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getSheetwisePosition(ch: Char): IntArray {
|
||||||
|
val sheetX: Int; val sheetY: Int
|
||||||
|
when (getSheetType(ch)) {
|
||||||
|
SHEET_UNIHAN -> {
|
||||||
|
sheetX = unihanIndexX(ch)
|
||||||
|
sheetY = unihanIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_EXTA_VARW -> {
|
||||||
|
sheetX = extAindexX(ch)
|
||||||
|
sheetY = extAindexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_EXTB_VARW -> {
|
||||||
|
sheetX = extBindexX(ch)
|
||||||
|
sheetY = extBindexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_KANA -> {
|
||||||
|
sheetX = kanaIndexX(ch)
|
||||||
|
sheetY = kanaIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_CJK_PUNCT -> {
|
||||||
|
sheetX = cjkPunctIndexX(ch)
|
||||||
|
sheetY = cjkPunctIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_CYRILIC_VARW -> {
|
||||||
|
sheetX = cyrilicIndexX(ch)
|
||||||
|
sheetY = cyrilicIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_FW_UNI -> {
|
||||||
|
sheetX = fullwidthUniIndexX(ch)
|
||||||
|
sheetY = fullwidthUniIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_UNI_PUNCT_VARW -> {
|
||||||
|
sheetX = uniPunctIndexX(ch)
|
||||||
|
sheetY = uniPunctIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_GREEK_VARW -> {
|
||||||
|
sheetX = greekIndexX(ch)
|
||||||
|
sheetY = greekIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_THAI_VARW -> {
|
||||||
|
sheetX = thaiIndexX(ch)
|
||||||
|
sheetY = thaiIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_CUSTOM_SYM -> {
|
||||||
|
sheetX = symbolIndexX(ch)
|
||||||
|
sheetY = symbolIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_HAYEREN_VARW -> {
|
||||||
|
sheetX = armenianIndexX(ch)
|
||||||
|
sheetY = armenianIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_KARTULI_VARW -> {
|
||||||
|
sheetX = kartvelianIndexX(ch)
|
||||||
|
sheetY = kartvelianIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_IPA_VARW -> {
|
||||||
|
sheetX = ipaIndexX(ch)
|
||||||
|
sheetY = ipaIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_RUNIC -> {
|
||||||
|
sheetX = runicIndexX(ch)
|
||||||
|
sheetY = runicIndexY(ch)
|
||||||
|
}
|
||||||
|
SHEET_LATIN_EXT_ADD_VARW -> {
|
||||||
|
sheetX = latinExtAddX(ch)
|
||||||
|
sheetY = latinExtAddY(ch)
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
sheetX = ch.toInt() % 16
|
||||||
|
sheetY = ch.toInt() / 16
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return intArrayOf(sheetX, sheetY)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun buildWidthTable(texture: Texture, codeRange: IntRange, cols: Int = 16) {
|
||||||
|
val binaryCodeOffset = W_VAR_INIT
|
||||||
|
|
||||||
|
val cellW = W_VAR_INIT + 1
|
||||||
|
val cellH = H
|
||||||
|
|
||||||
|
for (code in codeRange) {
|
||||||
|
|
||||||
|
val cellX = ((code - codeRange.start) % cols) * cellW
|
||||||
|
val cellY = ((code - codeRange.start) / cols) * cellH
|
||||||
|
|
||||||
|
val codeStartX = cellX + binaryCodeOffset
|
||||||
|
val codeStartY = cellY
|
||||||
|
|
||||||
|
var glyphWidth = 0
|
||||||
|
|
||||||
|
for (downCtr in 0..3) {
|
||||||
|
// if ALPHA is not zero, assume it's 1
|
||||||
|
if (texture.textureData[4 * (codeStartX + (codeStartY + downCtr) * texture.textureWidth) + 3] != 0.toByte()) {
|
||||||
|
glyphWidth = glyphWidth or (1 shl downCtr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val isDiacritics = texture.textureData[4 * (codeStartX + (codeStartY + H - 1) * texture.textureWidth) + 3] != 0.toByte()
|
||||||
|
if (isDiacritics)
|
||||||
|
glyphWidth = -glyphWidth
|
||||||
|
|
||||||
|
glyphWidths[code] = glyphWidth
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun getWidth(text: String): Int {
|
||||||
|
return getWidthOfCharSeq(text).sum()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var interchar = 0
|
||||||
|
var scale = 1
|
||||||
|
set(value) {
|
||||||
|
if (value > 0) field = value
|
||||||
|
else throw IllegalArgumentException("Font scale cannot be zero or negative (input: $value)")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun toColorCode(rgba4444: Int): String = GameFontBase.toColorCode(rgba4444)
|
||||||
|
fun toColorCode(r: Int, g: Int, b: Int, a: Int = 0x0F): String = toColorCode(r.shl(12) or g.shl(8) or b.shl(4) or a)
|
||||||
|
val noColorCode = toColorCode(0x0000)
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun toColorCode(rgba4444: Int): String = Character.toChars(0x100000 + rgba4444).toColCode()
|
||||||
|
fun toColorCode(r: Int, g: Int, b: Int, a: Int = 0x0F): String = toColorCode(r.shl(12) or g.shl(8) or b.shl(4) or a)
|
||||||
|
private fun CharArray.toColCode(): String = "${this[0]}${this[1]}"
|
||||||
|
|
||||||
|
val noColorCode = toColorCode(0x0000)
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
BIN
width_bit_encoding_annotated.png
Normal file
|
After Width: | Height: | Size: 18 KiB |