mirror of
https://github.com/curioustorvald/Terrarum-sans-bitmap.git
synced 2026-03-07 20:01:52 +09:00
new tagging system (see #5) WIP
- diacritics stacking does not work - centre align with align-to-this-x-pos is untested
This commit is contained in:
447
.idea/workspace.xml
generated
447
.idea/workspace.xml
generated
@@ -2,12 +2,17 @@
|
||||
<project version="4">
|
||||
<component name="ArtifactsWorkspaceSettings">
|
||||
<artifacts-to-build>
|
||||
<artifact name="FontDemoGDX" />
|
||||
<artifact name="TerrarumSansBitmap" />
|
||||
</artifacts-to-build>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="22c5bc80-996c-4846-b173-7dc8c2096fe3" name="Default" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/GlyphProps.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/thai_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/thai_variable.tga" 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" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt" afterDir="false" />
|
||||
</list>
|
||||
<ignored path="$PROJECT_DIR$/out/" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
@@ -27,8 +32,17 @@
|
||||
<file leaf-file-name="GameFontBase.kt" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="268">
|
||||
<caret line="145" column="17" selection-start-line="145" selection-start-column="17" selection-end-line="145" selection-end-column="17" />
|
||||
<state relative-caret-position="338">
|
||||
<caret line="613" column="62" selection-start-line="613" selection-start-column="62" selection-end-line="613" selection-end-column="62" />
|
||||
</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="325">
|
||||
<caret line="25" column="36" selection-start-line="25" selection-start-column="36" selection-end-line="25" selection-end-column="36" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -36,8 +50,22 @@
|
||||
<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="3689">
|
||||
<caret line="531" column="21" selection-start-line="531" selection-start-column="21" selection-end-line="531" selection-end-column="21" />
|
||||
<state relative-caret-position="52">
|
||||
<caret line="26" column="2" selection-start-line="26" selection-start-column="2" selection-end-line="26" selection-end-column="2" />
|
||||
</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="SPLIT">
|
||||
<first_editor relative-caret-position="234">
|
||||
<caret line="18" selection-start-line="18" selection-end-line="18" />
|
||||
</first_editor>
|
||||
<second_editor>
|
||||
<js_state />
|
||||
</second_editor>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -49,11 +77,8 @@
|
||||
<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="483">
|
||||
<caret line="134" column="40" selection-start-line="134" selection-start-column="40" selection-end-line="134" selection-end-column="40" />
|
||||
<folding>
|
||||
<element signature="e#48#162#0" expanded="true" />
|
||||
</folding>
|
||||
<state relative-caret-position="962">
|
||||
<caret line="178" lean-forward="true" selection-start-line="178" selection-end-line="178" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -61,27 +86,27 @@
|
||||
<file leaf-file-name="demotext.txt" pinned="false" current-in-tab="false">
|
||||
<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 relative-caret-position="663">
|
||||
<caret line="51" column="128" lean-forward="true" selection-start-line="51" selection-start-column="5" selection-end-line="51" selection-end-column="128" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="GameFontBase.kt" pinned="false" current-in-tab="false">
|
||||
<file leaf-file-name="GameFontBase.kt" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="3211">
|
||||
<caret line="277" column="5" selection-start-line="277" selection-start-column="5" selection-end-line="277" selection-end-column="5" />
|
||||
<state relative-caret-position="407">
|
||||
<caret line="444" column="46" lean-forward="true" selection-start-line="444" selection-start-column="46" selection-end-line="444" selection-end-column="46" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="README.md" pinned="false" current-in-tab="true">
|
||||
<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="SECOND">
|
||||
<first_editor relative-caret-position="273">
|
||||
<caret line="11" column="153" selection-start-line="11" selection-start-column="153" selection-end-line="11" selection-end-column="153" />
|
||||
<state split_layout="SPLIT">
|
||||
<first_editor relative-caret-position="427">
|
||||
<caret line="108" selection-start-line="108" selection-end-line="108" />
|
||||
</first_editor>
|
||||
<second_editor>
|
||||
<js_state />
|
||||
@@ -106,7 +131,6 @@
|
||||
<find>getG</find>
|
||||
<find>getWidt</find>
|
||||
<find>batch.color =</find>
|
||||
<find>getWidth</find>
|
||||
<find>f</find>
|
||||
<find>fun getWidth</find>
|
||||
<find>fun dispo</find>
|
||||
@@ -126,6 +150,14 @@
|
||||
<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>
|
||||
</findStrings>
|
||||
<replaceStrings>
|
||||
<replace>.141</replace>
|
||||
@@ -142,27 +174,29 @@
|
||||
<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$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt" />
|
||||
<option value="$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt" />
|
||||
<option value="$PROJECT_DIR$/FontTestGDX/demotext.txt" />
|
||||
<option value="$PROJECT_DIR$/README.md" />
|
||||
<option value="$PROJECT_DIR$/CONTRIBUTING.md" />
|
||||
<option value="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt" />
|
||||
<option value="$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt" />
|
||||
<option value="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/GlyphProps.kt" />
|
||||
<option value="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds" extendedState="7">
|
||||
<option name="x" value="1912" />
|
||||
<option name="y" value="-521" />
|
||||
<component name="ProjectFrameBounds" extendedState="6">
|
||||
<option name="x" value="-8" />
|
||||
<option name="y" value="-8" />
|
||||
<option name="width" value="1936" />
|
||||
<option name="height" value="1176" />
|
||||
<option name="height" value="1216" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator proportions="" version="1">
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="PackagesPane" />
|
||||
<pane id="Scope" />
|
||||
<pane id="PackagesPane" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
@@ -353,17 +387,14 @@
|
||||
<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" />
|
||||
<module name="BuildJAR_TerrarumSansBitmap" />
|
||||
<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="BuildJAR_TerrarumSansBitmap" />
|
||||
<envs />
|
||||
<method />
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="WORKING_DIRECTORY" />
|
||||
</configuration>
|
||||
<configuration default="true" type="Remote" factoryName="Remote">
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
@@ -420,12 +451,12 @@
|
||||
</todo-panel>
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="1912" y="-521" width="1936" height="1176" extended-state="7" />
|
||||
<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.32851636" />
|
||||
<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" />
|
||||
@@ -433,19 +464,43 @@
|
||||
<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 active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.12953092" />
|
||||
<window_info content_ui="combo" id="Project" order="0" weight="0.13859275" />
|
||||
<window_info anchor="bottom" id="Find" order="1" weight="0.32931355" />
|
||||
<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 anchor="bottom" id="Debug" order="3" visible="true" weight="0.23025048" />
|
||||
<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" />
|
||||
</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="Run" order="2" weight="0.2591522" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
<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="Version Control" order="9" />
|
||||
<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="Find" order="1" />
|
||||
<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" />
|
||||
@@ -460,6 +515,162 @@
|
||||
<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" 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" 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">
|
||||
@@ -481,9 +692,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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">
|
||||
@@ -491,9 +699,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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">
|
||||
@@ -501,9 +706,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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">
|
||||
@@ -511,9 +713,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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">
|
||||
@@ -521,8 +720,12 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
<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">
|
||||
@@ -531,8 +734,12 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
<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">
|
||||
@@ -541,9 +748,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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">
|
||||
@@ -551,9 +755,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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">
|
||||
@@ -561,29 +762,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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/gdx/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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/gdx/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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">
|
||||
@@ -612,9 +790,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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">
|
||||
@@ -622,9 +797,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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">
|
||||
@@ -639,13 +811,7 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="jar://$PROJECT_DIR$/lib/slick.jar!/org/newdawn/slick/Color.class">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="339">
|
||||
<caret line="76" column="11" selection-start-line="76" selection-start-column="11" selection-end-line="76" selection-end-column="11" />
|
||||
</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">
|
||||
@@ -658,9 +824,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$USER_HOME$/AppData/Local/Temp/Ихадоу адаҟьа.URL">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</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">
|
||||
@@ -668,35 +831,28 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="483">
|
||||
<caret line="134" column="40" selection-start-line="134" selection-start-column="40" selection-end-line="134" selection-end-column="40" />
|
||||
<folding>
|
||||
<element signature="e#48#162#0" expanded="true" />
|
||||
</folding>
|
||||
</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" />
|
||||
<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="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="3689">
|
||||
<caret line="531" column="21" selection-start-line="531" selection-start-column="21" selection-end-line="531" selection-end-column="21" />
|
||||
<state relative-caret-position="52">
|
||||
<caret line="26" column="2" selection-start-line="26" selection-start-column="2" selection-end-line="26" selection-end-column="2" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/README.md">
|
||||
<entry file="file://$PROJECT_DIR$/CONTRIBUTING.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||
<state split_layout="SECOND">
|
||||
<first_editor relative-caret-position="273">
|
||||
<caret line="11" column="153" selection-start-line="11" selection-start-column="153" selection-end-line="11" selection-end-column="153" />
|
||||
<state split_layout="SPLIT">
|
||||
<first_editor relative-caret-position="234">
|
||||
<caret line="18" selection-start-line="18" selection-end-line="18" />
|
||||
</first_editor>
|
||||
<second_editor>
|
||||
<js_state />
|
||||
@@ -704,10 +860,57 @@
|
||||
</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://$PROJECT_DIR$/FontTestGDX/lib/TerrarumSansBitmap.jar!/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="317">
|
||||
<caret line="870" column="29" selection-start-line="870" selection-start-column="29" selection-end-line="870" selection-end-column="29" />
|
||||
</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="325">
|
||||
<caret line="25" column="36" selection-start-line="25" selection-start-column="36" selection-end-line="25" selection-end-column="36" />
|
||||
</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="427">
|
||||
<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$/FontTestGDX/demotext.txt">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="663">
|
||||
<caret line="51" column="128" lean-forward="true" selection-start-line="51" selection-start-column="5" selection-end-line="51" selection-end-column="128" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="962">
|
||||
<caret line="178" lean-forward="true" selection-start-line="178" selection-end-line="178" />
|
||||
</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="268">
|
||||
<caret line="145" column="17" selection-start-line="145" selection-start-column="17" selection-end-line="145" selection-end-column="17" />
|
||||
<state relative-caret-position="407">
|
||||
<caret line="444" column="46" lean-forward="true" selection-start-line="444" selection-start-column="46" selection-end-line="444" selection-end-column="46" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
BIN
font_drawing_template.png
Normal file
BIN
font_drawing_template.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
28
src/net/torvald/terrarumsansbitmap/GlyphProps.kt
Normal file
28
src/net/torvald/terrarumsansbitmap/GlyphProps.kt
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
) {
|
||||
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
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Terrarum Sans Bitmap
|
||||
*
|
||||
* Copyright (c) 2017 Minjae Song (Torvald)
|
||||
* Copyright (c) 2017-2018 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
|
||||
@@ -29,6 +29,7 @@ import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.Pixmap
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.*
|
||||
import net.torvald.terrarumsansbitmap.GlyphProps
|
||||
import java.io.BufferedOutputStream
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
@@ -118,12 +119,12 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
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]
|
||||
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
|
||||
/*private fun isDiacritics(c: Char) = c.toInt() in 0xE34..0xE3A
|
||||
|| c.toInt() in 0xE47..0xE4E
|
||||
|| c.toInt() == 0xE31
|
||||
|| 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]
|
||||
@@ -217,7 +218,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
SHEET_EXTA_VARW,
|
||||
SHEET_EXTB_VARW,
|
||||
SHEET_CYRILIC_VARW,
|
||||
SHEET_UNI_PUNCT,
|
||||
SHEET_UNI_PUNCT_VARW,
|
||||
SHEET_GREEK_VARW,
|
||||
SHEET_THAI_VARW,
|
||||
SHEET_HAYEREN_VARW,
|
||||
@@ -276,7 +277,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
0xF00060..0xF000BF, // assign them to PUA
|
||||
0x13A0..0x13F5
|
||||
)
|
||||
private val glyphWidths: HashMap<Int, Int> = HashMap() // if the value is negative, it's diacritics
|
||||
private val glyphProps: HashMap<Int, GlyphProps> = HashMap()
|
||||
private val sheets: Array<TextureRegionPack>
|
||||
|
||||
private var charsetOverride = 0
|
||||
@@ -319,6 +320,8 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
}
|
||||
|
||||
|
||||
buildWidthTableFixed()
|
||||
|
||||
if (isVariable) {
|
||||
println("[TerrarumSansBitmap] loading texture $it [VARIABLE]")
|
||||
buildWidthTable(pixmap, codeRange[index], 16)
|
||||
@@ -388,8 +391,9 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
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
|
||||
private var posXbuffer = intArrayOf() // absolute posX of glyphs from print-origin
|
||||
private var posYbuffer = intArrayOf() // absolute posY of glyphs from print-origin
|
||||
private var glyphWidthBuffer = intArrayOf() // width of each glyph
|
||||
|
||||
private lateinit var originalColour: Color
|
||||
|
||||
@@ -407,22 +411,73 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
textBuffer = str
|
||||
val widths = getWidthOfCharSeq(str)
|
||||
|
||||
textBGSize = widths
|
||||
glyphWidthBuffer = 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
|
||||
posXbuffer = IntArray(str.length, { 0 })
|
||||
posYbuffer = IntArray(str.length, { 0 })
|
||||
|
||||
|
||||
var nonDiacriticCounter = 0 // index of last instance of non-diacritic char
|
||||
var stackUpwardCounter = 0
|
||||
var stackDownwardCounter = 0
|
||||
for (charIndex in 0 until posXbuffer.size) {
|
||||
if (charIndex > 0) {
|
||||
// nonDiacriticCounter allows multiple diacritics
|
||||
|
||||
val thisChar = textBuffer[charIndex]
|
||||
if (glyphProps[thisChar.toInt()] == null) {
|
||||
throw InternalError("No props for char '$thisChar' (${thisChar.toInt().toString(16)})")
|
||||
}
|
||||
val thisProp = glyphProps[thisChar.toInt()]!!
|
||||
val lastNonDiacriticChar = textBuffer[nonDiacriticCounter]
|
||||
val itsProp = glyphProps[lastNonDiacriticChar.toInt()]!!
|
||||
|
||||
val alignmentOffset = when (thisProp.alignWhere) {
|
||||
GlyphProps.LEFT -> 0
|
||||
GlyphProps.RIGHT -> thisProp.width - W_VAR_INIT
|
||||
GlyphProps.CENTRE -> Math.floor((thisProp.width - W_VAR_INIT) / 2.0).toInt()
|
||||
else -> throw InternalError("Unsupported alignment: ${thisProp.alignWhere}")
|
||||
}
|
||||
|
||||
if (!thisProp.writeOnTop) {
|
||||
posXbuffer[charIndex] = posXbuffer[nonDiacriticCounter] + itsProp.width + alignmentOffset + interchar
|
||||
nonDiacriticCounter = charIndex
|
||||
stackUpwardCounter = 0
|
||||
stackDownwardCounter = 0
|
||||
}
|
||||
else {
|
||||
// set X pos according to alignment information
|
||||
posXbuffer[charIndex] = when (thisProp.alignWhere) {
|
||||
GlyphProps.LEFT -> posXbuffer[nonDiacriticCounter]
|
||||
GlyphProps.RIGHT -> {
|
||||
posXbuffer[nonDiacriticCounter] - (W_VAR_INIT - itsProp.width)
|
||||
}
|
||||
GlyphProps.CENTRE -> {
|
||||
val alignXPos = if (itsProp.alignXPos == 0) itsProp.width.div(2) else itsProp.alignXPos
|
||||
|
||||
posXbuffer[nonDiacriticCounter] + alignXPos - (W_VAR_INIT - 1).div(2)
|
||||
}
|
||||
else -> throw InternalError("Unsupported alignment: ${thisProp.alignWhere}")
|
||||
}
|
||||
|
||||
|
||||
// set Y pos according to diacritics position
|
||||
if (thisProp.diacriticsStackDown) {
|
||||
posYbuffer[charIndex] = -H_DIACRITICS * stackDownwardCounter
|
||||
stackDownwardCounter++
|
||||
}
|
||||
else {
|
||||
posYbuffer[charIndex] = H_DIACRITICS * stackDownwardCounter
|
||||
stackUpwardCounter++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//print("[TerrarumSansBitmap] widthTable for $textBuffer: ")
|
||||
//textBWidth.forEach { print("$it ") }; println()
|
||||
//posXbuffer.forEach { print("$it ") }; println()
|
||||
|
||||
|
||||
originalColour = batch.color.cpy()
|
||||
@@ -480,39 +535,39 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
if (!noShadow) {
|
||||
batch.color = shadowCol
|
||||
|
||||
batch.draw(hangulSheet.get(indexCho, choRow ), x + textBWidth[index] + 1, y)
|
||||
batch.draw(hangulSheet.get(indexCho, choRow ), x + textBWidth[index] , y + if (flipY) 1 else -1)
|
||||
batch.draw(hangulSheet.get(indexCho, choRow ), x + textBWidth[index] + 1, y + if (flipY) 1 else -1)
|
||||
batch.draw(hangulSheet.get(indexCho, choRow ), x + posXbuffer[index] + 1, y)
|
||||
batch.draw(hangulSheet.get(indexCho, choRow ), x + posXbuffer[index] , y + if (flipY) 1 else -1)
|
||||
batch.draw(hangulSheet.get(indexCho, choRow ), x + posXbuffer[index] + 1, y + if (flipY) 1 else -1)
|
||||
|
||||
batch.draw(hangulSheet.get(indexJung, jungRow), x + textBWidth[index] + 1, y)
|
||||
batch.draw(hangulSheet.get(indexJung, jungRow), x + textBWidth[index] , y + if (flipY) 1 else -1)
|
||||
batch.draw(hangulSheet.get(indexJung, jungRow), x + textBWidth[index] + 1, y + if (flipY) 1 else -1)
|
||||
batch.draw(hangulSheet.get(indexJung, jungRow), x + posXbuffer[index] + 1, y)
|
||||
batch.draw(hangulSheet.get(indexJung, jungRow), x + posXbuffer[index] , y + if (flipY) 1 else -1)
|
||||
batch.draw(hangulSheet.get(indexJung, jungRow), x + posXbuffer[index] + 1, y + if (flipY) 1 else -1)
|
||||
|
||||
batch.draw(hangulSheet.get(indexJong, jongRow), x + textBWidth[index] + 1, y)
|
||||
batch.draw(hangulSheet.get(indexJong, jongRow), x + textBWidth[index] , y + if (flipY) 1 else -1)
|
||||
batch.draw(hangulSheet.get(indexJong, jongRow), x + textBWidth[index] + 1, y + if (flipY) 1 else -1)
|
||||
batch.draw(hangulSheet.get(indexJong, jongRow), x + posXbuffer[index] + 1, y)
|
||||
batch.draw(hangulSheet.get(indexJong, jongRow), x + posXbuffer[index] , y + if (flipY) 1 else -1)
|
||||
batch.draw(hangulSheet.get(indexJong, jongRow), x + posXbuffer[index] + 1, y + if (flipY) 1 else -1)
|
||||
}
|
||||
|
||||
|
||||
batch.color = mainCol
|
||||
batch.draw(hangulSheet.get(indexCho, choRow) , x + textBWidth[index], y)
|
||||
batch.draw(hangulSheet.get(indexJung, jungRow), x + textBWidth[index], y)
|
||||
batch.draw(hangulSheet.get(indexJong, jongRow), x + textBWidth[index], y)
|
||||
batch.draw(hangulSheet.get(indexCho, choRow) , x + posXbuffer[index], y)
|
||||
batch.draw(hangulSheet.get(indexJung, jungRow), x + posXbuffer[index], y)
|
||||
batch.draw(hangulSheet.get(indexJong, jongRow), x + posXbuffer[index], y)
|
||||
}
|
||||
else {
|
||||
try {
|
||||
val offset = if (!isDiacritics(c)) 0 else {
|
||||
/*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
|
||||
(glyphWidthBuffer[index] - glyphWidthBuffer[index - 1]) / 2
|
||||
else
|
||||
textBGSize[index]
|
||||
glyphWidthBuffer[index]
|
||||
}
|
||||
|
||||
if (!noShadow) {
|
||||
batch.color = shadowCol
|
||||
batch.draw(
|
||||
sheets[sheetID].get(sheetX, sheetY),
|
||||
x + textBWidth[index] + 1 + offset,
|
||||
x + posXbuffer[index] + 1 + offset,
|
||||
y + (if (sheetID == SHEET_UNIHAN) // evil exceptions
|
||||
offsetUnihan.flipY()
|
||||
else if (sheetID == SHEET_CUSTOM_SYM)
|
||||
@@ -522,7 +577,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
)
|
||||
batch.draw(
|
||||
sheets[sheetID].get(sheetX, sheetY),
|
||||
x + textBWidth[index] + offset,
|
||||
x + posXbuffer[index] + offset,
|
||||
y + (if (sheetID == SHEET_UNIHAN) // evil exceptions
|
||||
offsetUnihan.flipY() + 1
|
||||
else if (sheetID == SHEET_CUSTOM_SYM)
|
||||
@@ -532,7 +587,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
)
|
||||
batch.draw(
|
||||
sheets[sheetID].get(sheetX, sheetY),
|
||||
x + textBWidth[index] + 1 + offset,
|
||||
x + posXbuffer[index] + 1 + offset,
|
||||
y + (if (sheetID == SHEET_UNIHAN) // evil exceptions
|
||||
offsetUnihan.flipY() + 1
|
||||
else if (sheetID == SHEET_CUSTOM_SYM)
|
||||
@@ -546,14 +601,27 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
batch.color = mainCol
|
||||
batch.draw(
|
||||
sheets[sheetID].get(sheetX, sheetY),
|
||||
x + textBWidth[index] + offset,
|
||||
x + posXbuffer[index] + offset,
|
||||
y +
|
||||
if (sheetID == SHEET_UNIHAN) // evil exceptions
|
||||
offsetUnihan
|
||||
else if (sheetID == SHEET_CUSTOM_SYM)
|
||||
offsetCustomSym
|
||||
else 0
|
||||
)
|
||||
)*/
|
||||
|
||||
batch.color = mainCol
|
||||
val posY = y + posYbuffer[index].flipY() +
|
||||
if (sheetID == SHEET_UNIHAN) // evil exceptions
|
||||
offsetUnihan
|
||||
else if (sheetID == SHEET_CUSTOM_SYM)
|
||||
offsetCustomSym
|
||||
else 0
|
||||
|
||||
val posX = x + posXbuffer[index]
|
||||
val texture = sheets[sheetID].get(sheetX, sheetY)
|
||||
|
||||
batch.draw(texture, posX, posY)
|
||||
}
|
||||
catch (noSuchGlyph: ArrayIndexOutOfBoundsException) {
|
||||
batch.color = mainCol
|
||||
@@ -583,12 +651,14 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
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()}")
|
||||
if (!glyphProps.containsKey(chr.toInt())) {
|
||||
System.err.println("[TerrarumSansBitmap] no width data for glyph number ${Integer.toHexString(chr.toInt()).toUpperCase()}")
|
||||
len[i] = W_LATIN_WIDE
|
||||
}
|
||||
|
||||
len[i] = glyphWidths[chr.toInt()]!!
|
||||
val prop = glyphProps[chr.toInt()]!!
|
||||
//println("${chr.toInt()} -> $prop")
|
||||
len[i] = prop.width * (if (prop.writeOnTop) -1 else 1)
|
||||
}
|
||||
else if (isColourCodeHigh(chr) || isColourCodeLow(chr) || isCharsetOverrideHigh(chr) || isCharsetOverrideLow(chr))
|
||||
len[i] = 0
|
||||
@@ -632,7 +702,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
else if (isCyrilic(c))
|
||||
return SHEET_CYRILIC_VARW
|
||||
else if (isUniPunct(c))
|
||||
return SHEET_UNI_PUNCT
|
||||
return SHEET_UNI_PUNCT_VARW
|
||||
else if (isCJKPunct(c))
|
||||
return SHEET_CJK_PUNCT
|
||||
else if (isFullwidthUni(c))
|
||||
@@ -692,7 +762,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
sheetX = fullwidthUniIndexX(ch)
|
||||
sheetY = fullwidthUniIndexY(ch)
|
||||
}
|
||||
SHEET_UNI_PUNCT -> {
|
||||
SHEET_UNI_PUNCT_VARW -> {
|
||||
sheetX = uniPunctIndexX(ch)
|
||||
sheetY = uniPunctIndexY(ch)
|
||||
}
|
||||
@@ -758,23 +828,48 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
|
||||
val codeStartX = cellX + binaryCodeOffset
|
||||
val codeStartY = cellY
|
||||
val tagStartY = codeStartY + 11
|
||||
|
||||
var glyphWidth = 0
|
||||
for (downCtr in 0..3) {
|
||||
|
||||
var width = 0
|
||||
var tags = 0
|
||||
|
||||
for (y in 0 until 4) {
|
||||
// if ALPHA is not zero, assume it's 1
|
||||
if (pixmap.getPixel(codeStartX, codeStartY + downCtr).and(0xFF) != 0) {
|
||||
glyphWidth = glyphWidth or (1 shl downCtr)
|
||||
if (pixmap.getPixel(codeStartX, codeStartY + y).and(0xFF) != 0) {
|
||||
width = width or (1 shl y)
|
||||
}
|
||||
}
|
||||
|
||||
val isDiacritics = pixmap.getPixel(codeStartX, codeStartY + H - 1).and(0xFF) != 0
|
||||
for (y in 0 until 9) {
|
||||
// if ALPHA is not zero, assume it's 1
|
||||
if (pixmap.getPixel(codeStartX, tagStartY + y).and(0xFF) != 0) {
|
||||
tags = tags or (1 shl y)
|
||||
}
|
||||
}
|
||||
|
||||
//println("Width table: $code, $tags")
|
||||
|
||||
/*val isDiacritics = pixmap.getPixel(codeStartX, codeStartY + H - 1).and(0xFF) != 0
|
||||
if (isDiacritics)
|
||||
glyphWidth = -glyphWidth
|
||||
glyphWidth = -glyphWidth*/
|
||||
|
||||
glyphWidths[code] = glyphWidth
|
||||
glyphProps[code] = GlyphProps(width, tags)
|
||||
}
|
||||
}
|
||||
|
||||
fun buildWidthTableFixed() {
|
||||
// fixed-width props
|
||||
this.codeRange[SHEET_CJK_PUNCT].forEach { glyphProps[it] = GlyphProps(W_ASIAN_PUNCT, 0) }
|
||||
this.codeRange[SHEET_CUSTOM_SYM].forEach { glyphProps[it] = GlyphProps(20, 0) }
|
||||
this.codeRange[SHEET_FW_UNI].forEach { glyphProps[it] = GlyphProps(W_UNIHAN, 0) }
|
||||
this.codeRange[SHEET_HANGUL].forEach { glyphProps[it] = GlyphProps(W_HANGUL, 0) }
|
||||
this.codeRange[SHEET_KANA].forEach { glyphProps[it] = GlyphProps(W_KANA, 0) }
|
||||
this.codeRange[SHEET_RUNIC].forEach { glyphProps[it] = GlyphProps(9, 0) }
|
||||
this.codeRange[SHEET_UNIHAN].forEach { glyphProps[it] = GlyphProps(W_UNIHAN, 0) }
|
||||
(0xD800..0xDFFF).forEach { glyphProps[it] = GlyphProps(0, 0) }
|
||||
}
|
||||
|
||||
private val glyphLayout = GlyphLayout()
|
||||
|
||||
fun getWidth(text: String): Int {
|
||||
@@ -807,13 +902,15 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
internal val W_KANA = 12
|
||||
internal val W_UNIHAN = 16
|
||||
internal val W_LATIN_WIDE = 9 // width of regular letters
|
||||
internal val W_VAR_INIT = 15
|
||||
internal val W_VAR_INIT = 15 // it assumes width of 15 regardless of the tagged width
|
||||
|
||||
internal val HGAP_VAR = 1
|
||||
|
||||
internal val H = 20
|
||||
internal val H_UNIHAN = 16
|
||||
|
||||
internal val H_DIACRITICS = 4
|
||||
|
||||
internal val SIZE_CUSTOM_SYM = 18
|
||||
|
||||
internal val SHEET_ASCII_VARW = 0
|
||||
@@ -825,7 +922,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
internal val SHEET_UNIHAN = 6
|
||||
internal val SHEET_CYRILIC_VARW = 7
|
||||
internal val SHEET_FW_UNI = 8
|
||||
internal val SHEET_UNI_PUNCT = 9
|
||||
internal val SHEET_UNI_PUNCT_VARW = 9
|
||||
internal val SHEET_GREEK_VARW = 10
|
||||
internal val SHEET_THAI_VARW = 11
|
||||
internal val SHEET_HAYEREN_VARW = 12
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
package net.torvald.terrarumsansbitmap.slick2d
|
||||
|
||||
import net.torvald.terrarumsansbitmap.gdx.GameFontBase
|
||||
/*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
|
||||
@@ -46,7 +46,7 @@ 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
|
||||
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
|
||||
@@ -144,7 +144,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false) : Font {
|
||||
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]
|
||||
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
|
||||
@@ -238,7 +238,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false) : Font {
|
||||
SHEET_EXTA_VARW,
|
||||
SHEET_EXTB_VARW,
|
||||
SHEET_CYRILIC_VARW,
|
||||
SHEET_UNI_PUNCT,
|
||||
SHEET_UNI_PUNCT_VARW,
|
||||
SHEET_GREEK_VARW,
|
||||
SHEET_THAI_VARW,
|
||||
SHEET_HAYEREN_VARW,
|
||||
@@ -628,7 +628,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false) : Font {
|
||||
else if (isCyrilic(c))
|
||||
return SHEET_CYRILIC_VARW
|
||||
else if (isUniPunct(c))
|
||||
return SHEET_UNI_PUNCT
|
||||
return SHEET_UNI_PUNCT_VARW
|
||||
else if (isCJKPunct(c))
|
||||
return SHEET_CJK_PUNCT
|
||||
else if (isFullwidthUni(c))
|
||||
@@ -686,7 +686,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false) : Font {
|
||||
sheetX = fullwidthUniIndexX(ch)
|
||||
sheetY = fullwidthUniIndexY(ch)
|
||||
}
|
||||
SHEET_UNI_PUNCT -> {
|
||||
SHEET_UNI_PUNCT_VARW -> {
|
||||
sheetX = uniPunctIndexX(ch)
|
||||
sheetY = uniPunctIndexY(ch)
|
||||
}
|
||||
@@ -787,4 +787,4 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false) : Font {
|
||||
|
||||
val noColorCode = toColorCode(0x0000)
|
||||
}
|
||||
}
|
||||
}*/
|
||||
Reference in New Issue
Block a user