Browse Source

Custom font engine demo implemented in bitmap font sample.

Michael Ragazzon 6 years ago
parent
commit
f713bc412d

+ 4 - 0
CMake/SampleFileList.cmake

@@ -33,9 +33,13 @@ set(benchmark_SRC_FILES
 )
 
 set(bitmapfont_HDR_FILES
+    ${PROJECT_SOURCE_DIR}/Samples/basic/bitmapfont/src/FontEngineBitmap.h
+    ${PROJECT_SOURCE_DIR}/Samples/basic/bitmapfont/src/FontEngineInterfaceBitmap.h
 )
 
 set(bitmapfont_SRC_FILES
+    ${PROJECT_SOURCE_DIR}/Samples/basic/bitmapfont/src/FontEngineBitmap.cpp
+    ${PROJECT_SOURCE_DIR}/Samples/basic/bitmapfont/src/FontEngineInterfaceBitmap.cpp
     ${PROJECT_SOURCE_DIR}/Samples/basic/bitmapfont/src/main.cpp
 )
 

+ 3 - 0
CMakeLists.txt

@@ -668,6 +668,9 @@ if(BUILD_SAMPLES)
 	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/basic/benchmark/data
 			DESTINATION ${SAMPLES_DIR}/basic/benchmark
 	)
+	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/basic/bitmapfont/data
+			DESTINATION ${SAMPLES_DIR}/basic/bitmapfont
+	)
 	install(DIRECTORY ${PROJECT_SOURCE_DIR}/Samples/basic/demo/data
 			DESTINATION ${SAMPLES_DIR}/basic/demo
 	)

+ 0 - 270
Samples/assets/Arial.fnt

@@ -1,270 +0,0 @@
-<?xml version="1.0"?>
-<font>
-  <info face="Arial" size="26" bold="0" italic="0" src="Arial_0.tga"/>
-  <common lineHeight="26" base="26" scaleW="1024" scaleH="1024" />
-  <chars count="191">
-    <char id="32" x="170" y="40" width="1" height="1" xoffset="0" yoffset="21" xadvance="6" />
-    <char id="33" x="643" y="19" width="2" height="17" xoffset="3" yoffset="4" xadvance="8" />
-    <char id="34" x="63" y="41" width="6" height="6" xoffset="1" yoffset="4" xadvance="8" />
-    <char id="35" x="84" y="23" width="13" height="17" xoffset="0" yoffset="4" xadvance="13" />
-    <char id="36" x="511" y="0" width="11" height="20" xoffset="1" yoffset="3" xadvance="13" />
-    <char id="37" x="724" y="0" width="18" height="17" xoffset="1" yoffset="4" xadvance="20" />
-    <char id="38" x="56" y="23" width="13" height="17" xoffset="1" yoffset="4" xadvance="15" />
-    <char id="39" x="77" y="41" width="2" height="6" xoffset="1" yoffset="4" xadvance="4" />
-    <char id="40" x="91" y="0" width="5" height="22" xoffset="1" yoffset="4" xadvance="8" />
-    <char id="41" x="97" y="0" width="5" height="22" xoffset="2" yoffset="4" xadvance="8" />
-    <char id="42" x="54" y="41" width="8" height="7" xoffset="1" yoffset="4" xadvance="9" />
-    <char id="43" x="916" y="18" width="12" height="12" xoffset="1" yoffset="7" xadvance="13" />
-    <char id="44" x="80" y="41" width="2" height="5" xoffset="2" yoffset="19" xadvance="6" />
-    <char id="45" x="149" y="40" width="7" height="2" xoffset="0" yoffset="14" xadvance="8" />
-    <char id="46" x="167" y="40" width="2" height="2" xoffset="2" yoffset="19" xadvance="6" />
-    <char id="47" x="604" y="19" width="7" height="17" xoffset="0" yoffset="4" xadvance="6" />
-    <char id="48" x="273" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="49" x="620" y="19" width="6" height="17" xoffset="3" yoffset="4" xadvance="13" />
-    <char id="50" x="285" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="51" x="345" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="52" x="441" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="53" x="453" y="21" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="54" x="189" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="55" x="261" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="56" x="201" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="57" x="213" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="58" x="913" y="18" width="2" height="13" xoffset="2" yoffset="8" xadvance="6" />
-    <char id="59" x="717" y="18" width="2" height="16" xoffset="2" yoffset="8" xadvance="6" />
-    <char id="60" x="941" y="18" width="10" height="11" xoffset="1" yoffset="7" xadvance="13" />
-    <char id="61" x="32" y="41" width="10" height="7" xoffset="1" yoffset="9" xadvance="13" />
-    <char id="62" x="952" y="18" width="10" height="11" xoffset="1" yoffset="7" xadvance="13" />
-    <char id="63" x="225" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="64" x="0" y="0" width="21" height="22" xoffset="1" yoffset="4" xadvance="23" />
-    <char id="65" x="816" y="0" width="17" height="17" xoffset="-1" yoffset="4" xadvance="15" />
-    <char id="66" x="124" y="22" width="12" height="17" xoffset="2" yoffset="4" xadvance="15" />
-    <char id="67" x="919" y="0" width="15" height="17" xoffset="1" yoffset="4" xadvance="17" />
-    <char id="68" x="951" y="0" width="14" height="17" xoffset="2" yoffset="4" xadvance="17" />
-    <char id="69" x="163" y="22" width="12" height="17" xoffset="2" yoffset="4" xadvance="15" />
-    <char id="70" x="237" y="22" width="11" height="17" xoffset="2" yoffset="4" xadvance="14" />
-    <char id="71" x="869" y="0" width="16" height="17" xoffset="1" yoffset="4" xadvance="18" />
-    <char id="72" x="42" y="23" width="13" height="17" xoffset="2" yoffset="4" xadvance="17" />
-    <char id="73" x="640" y="19" width="2" height="17" xoffset="2" yoffset="4" xadvance="6" />
-    <char id="74" x="576" y="19" width="9" height="17" xoffset="1" yoffset="4" xadvance="12" />
-    <char id="75" x="996" y="0" width="14" height="17" xoffset="2" yoffset="4" xadvance="15" />
-    <char id="76" x="543" y="19" width="10" height="17" xoffset="2" yoffset="4" xadvance="13" />
-    <char id="77" x="935" y="0" width="15" height="17" xoffset="2" yoffset="4" xadvance="19" />
-    <char id="78" x="70" y="23" width="13" height="17" xoffset="2" yoffset="4" xadvance="17" />
-    <char id="79" x="852" y="0" width="16" height="17" xoffset="1" yoffset="4" xadvance="18" />
-    <char id="80" x="98" y="23" width="12" height="17" xoffset="2" yoffset="4" xadvance="15" />
-    <char id="81" x="560" y="0" width="16" height="18" xoffset="1" yoffset="4" xadvance="18" />
-    <char id="82" x="981" y="0" width="14" height="17" xoffset="2" yoffset="4" xadvance="17" />
-    <char id="83" x="28" y="23" width="13" height="17" xoffset="1" yoffset="4" xadvance="15" />
-    <char id="84" x="1011" y="0" width="12" height="17" xoffset="1" yoffset="4" xadvance="14" />
-    <char id="85" x="14" y="23" width="13" height="17" xoffset="2" yoffset="4" xadvance="17" />
-    <char id="86" x="798" y="0" width="17" height="17" xoffset="-1" yoffset="4" xadvance="15" />
-    <char id="87" x="657" y="0" width="23" height="17" xoffset="0" yoffset="4" xadvance="23" />
-    <char id="88" x="903" y="0" width="15" height="17" xoffset="0" yoffset="4" xadvance="15" />
-    <char id="89" x="966" y="0" width="14" height="17" xoffset="0" yoffset="4" xadvance="14" />
-    <char id="90" x="0" y="23" width="13" height="17" xoffset="0" yoffset="4" xadvance="14" />
-    <char id="91" x="108" y="0" width="4" height="22" xoffset="1" yoffset="4" xadvance="6" />
-    <char id="92" x="612" y="19" width="7" height="17" xoffset="0" yoffset="4" xadvance="6" />
-    <char id="93" x="103" y="0" width="4" height="22" xoffset="1" yoffset="4" xadvance="6" />
-    <char id="94" x="983" y="18" width="10" height="9" xoffset="1" yoffset="4" xadvance="12" />
-    <char id="95" x="111" y="41" width="14" height="2" xoffset="-1" yoffset="24" xadvance="13" />
-    <char id="96" x="106" y="41" width="4" height="3" xoffset="1" yoffset="4" xadvance="8" />
-    <char id="97" x="814" y="18" width="11" height="13" xoffset="1" yoffset="8" xadvance="13" />
-    <char id="98" x="477" y="21" width="10" height="17" xoffset="1" yoffset="4" xadvance="12" />
-    <char id="99" x="850" y="18" width="10" height="13" xoffset="1" yoffset="8" xadvance="12" />
-    <char id="100" x="565" y="19" width="10" height="17" xoffset="1" yoffset="4" xadvance="12" />
-    <char id="101" x="826" y="18" width="11" height="13" xoffset="1" yoffset="8" xadvance="13" />
-    <char id="102" x="595" y="19" width="8" height="17" xoffset="0" yoffset="4" xadvance="7" />
-    <char id="103" x="614" y="0" width="10" height="18" xoffset="1" yoffset="8" xadvance="12" />
-    <char id="104" x="554" y="19" width="10" height="17" xoffset="1" yoffset="4" xadvance="12" />
-    <char id="105" x="637" y="19" width="2" height="17" xoffset="1" yoffset="4" xadvance="5" />
-    <char id="106" x="85" y="0" width="5" height="22" xoffset="-2" yoffset="4" xadvance="4" />
-    <char id="107" x="249" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="11" />
-    <char id="108" x="646" y="19" width="2" height="17" xoffset="1" yoffset="4" xadvance="4" />
-    <char id="109" x="771" y="18" width="16" height="13" xoffset="1" yoffset="8" xadvance="18" />
-    <char id="110" x="894" y="18" width="10" height="13" xoffset="1" yoffset="8" xadvance="12" />
-    <char id="111" x="802" y="18" width="11" height="13" xoffset="1" yoffset="8" xadvance="13" />
-    <char id="112" x="636" y="0" width="10" height="18" xoffset="1" yoffset="8" xadvance="12" />
-    <char id="113" x="591" y="0" width="11" height="18" xoffset="0" yoffset="8" xadvance="12" />
-    <char id="114" x="905" y="18" width="7" height="13" xoffset="1" yoffset="8" xadvance="8" />
-    <char id="115" x="883" y="18" width="10" height="13" xoffset="1" yoffset="8" xadvance="12" />
-    <char id="116" x="647" y="0" width="6" height="18" xoffset="0" yoffset="3" xadvance="6" />
-    <char id="117" x="861" y="18" width="10" height="13" xoffset="1" yoffset="8" xadvance="12" />
-    <char id="118" x="788" y="18" width="13" height="13" xoffset="-1" yoffset="8" xadvance="11" />
-    <char id="119" x="753" y="18" width="17" height="13" xoffset="-1" yoffset="8" xadvance="15" />
-    <char id="120" x="838" y="18" width="11" height="13" xoffset="0" yoffset="8" xadvance="11" />
-    <char id="121" x="577" y="0" width="13" height="18" xoffset="-1" yoffset="8" xadvance="11" />
-    <char id="122" x="872" y="18" width="10" height="13" xoffset="0" yoffset="8" xadvance="11" />
-    <char id="123" x="71" y="0" width="6" height="22" xoffset="1" yoffset="4" xadvance="8" />
-    <char id="124" x="113" y="0" width="2" height="22" xoffset="2" yoffset="4" xadvance="6" />
-    <char id="125" x="78" y="0" width="6" height="22" xoffset="1" yoffset="4" xadvance="8" />
-    <char id="126" x="83" y="41" width="11" height="4" xoffset="1" yoffset="11" xadvance="13" />
-    <char id="160" x="172" y="40" width="1" height="1" xoffset="0" yoffset="21" xadvance="6" />
-    <char id="161" x="654" y="0" width="2" height="18" xoffset="3" yoffset="8" xadvance="8" />
-    <char id="162" x="60" y="0" width="10" height="22" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="163" x="111" y="23" width="12" height="17" xoffset="0" yoffset="4" xadvance="13" />
-    <char id="164" x="929" y="18" width="11" height="11" xoffset="1" yoffset="7" xadvance="13" />
-    <char id="165" x="176" y="22" width="12" height="17" xoffset="0" yoffset="4" xadvance="13" />
-    <char id="166" x="116" y="0" width="2" height="22" xoffset="2" yoffset="4" xadvance="6" />
-    <char id="167" x="48" y="0" width="11" height="22" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="168" x="157" y="40" width="6" height="2" xoffset="1" yoffset="4" xadvance="8" />
-    <char id="169" x="762" y="0" width="17" height="17" xoffset="0" yoffset="4" xadvance="17" />
-    <char id="170" x="8" y="41" width="7" height="8" xoffset="1" yoffset="4" xadvance="9" />
-    <char id="171" x="973" y="18" width="9" height="10" xoffset="1" yoffset="10" xadvance="13" />
-    <char id="172" x="43" y="41" width="10" height="7" xoffset="1" yoffset="9" xadvance="13" />
-    <char id="173" x="141" y="40" width="7" height="2" xoffset="0" yoffset="14" xadvance="8" />
-    <char id="174" x="834" y="0" width="17" height="17" xoffset="0" yoffset="4" xadvance="17" />
-    <char id="175" x="126" y="40" width="14" height="2" xoffset="-1" yoffset="1" xadvance="13" />
-    <char id="176" x="70" y="41" width="6" height="6" xoffset="1" yoffset="4" xadvance="9" />
-    <char id="177" x="720" y="18" width="12" height="14" xoffset="1" yoffset="7" xadvance="13" />
-    <char id="178" x="16" y="41" width="7" height="8" xoffset="0" yoffset="4" xadvance="8" />
-    <char id="179" x="0" y="41" width="7" height="8" xoffset="0" yoffset="4" xadvance="8" />
-    <char id="180" x="101" y="41" width="4" height="3" xoffset="3" yoffset="4" xadvance="8" />
-    <char id="181" x="603" y="0" width="10" height="18" xoffset="1" yoffset="8" xadvance="12" />
-    <char id="182" x="378" y="0" width="12" height="21" xoffset="0" yoffset="4" xadvance="12" />
-    <char id="183" x="164" y="40" width="2" height="2" xoffset="3" yoffset="12" xadvance="8" />
-    <char id="184" x="95" y="41" width="5" height="4" xoffset="1" yoffset="21" xadvance="8" />
-    <char id="185" x="1017" y="18" width="5" height="8" xoffset="1" yoffset="4" xadvance="8" />
-    <char id="186" x="24" y="41" width="7" height="8" xoffset="1" yoffset="4" xadvance="9" />
-    <char id="187" x="963" y="18" width="9" height="10" xoffset="3" yoffset="10" xadvance="13" />
-    <char id="188" x="705" y="0" width="18" height="17" xoffset="1" yoffset="4" xadvance="19" />
-    <char id="189" x="780" y="0" width="17" height="17" xoffset="1" yoffset="4" xadvance="19" />
-    <char id="190" x="743" y="0" width="18" height="17" xoffset="0" yoffset="4" xadvance="19" />
-    <char id="191" x="625" y="0" width="10" height="18" xoffset="2" yoffset="8" xadvance="14" />
-    <char id="192" x="137" y="0" width="17" height="21" xoffset="-1" yoffset="0" xadvance="15" />
-    <char id="193" x="173" y="0" width="17" height="21" xoffset="-1" yoffset="0" xadvance="15" />
-    <char id="194" x="191" y="0" width="17" height="21" xoffset="-1" yoffset="0" xadvance="15" />
-    <char id="195" x="155" y="0" width="17" height="21" xoffset="-1" yoffset="0" xadvance="15" />
-    <char id="196" x="449" y="0" width="17" height="20" xoffset="-1" yoffset="1" xadvance="15" />
-    <char id="197" x="119" y="0" width="17" height="21" xoffset="-1" yoffset="0" xadvance="15" />
-    <char id="198" x="681" y="0" width="23" height="17" xoffset="-1" yoffset="4" xadvance="23" />
-    <char id="199" x="277" y="0" width="15" height="21" xoffset="1" yoffset="4" xadvance="17" />
-    <char id="200" x="404" y="0" width="12" height="21" xoffset="2" yoffset="0" xadvance="15" />
-    <char id="201" x="391" y="0" width="12" height="21" xoffset="2" yoffset="0" xadvance="15" />
-    <char id="202" x="417" y="0" width="12" height="21" xoffset="2" yoffset="0" xadvance="15" />
-    <char id="203" x="498" y="0" width="12" height="20" xoffset="2" yoffset="1" xadvance="15" />
-    <char id="204" x="444" y="0" width="4" height="21" xoffset="1" yoffset="0" xadvance="6" />
-    <char id="205" x="439" y="0" width="4" height="21" xoffset="1" yoffset="0" xadvance="6" />
-    <char id="206" x="430" y="0" width="8" height="21" xoffset="-1" yoffset="0" xadvance="6" />
-    <char id="207" x="523" y="0" width="6" height="20" xoffset="0" yoffset="1" xadvance="6" />
-    <char id="208" x="886" y="0" width="16" height="17" xoffset="0" yoffset="4" xadvance="17" />
-    <char id="209" x="364" y="0" width="13" height="21" xoffset="2" yoffset="0" xadvance="17" />
-    <char id="210" x="209" y="0" width="16" height="21" xoffset="1" yoffset="0" xadvance="18" />
-    <char id="211" x="260" y="0" width="16" height="21" xoffset="1" yoffset="0" xadvance="18" />
-    <char id="212" x="243" y="0" width="16" height="21" xoffset="1" yoffset="0" xadvance="18" />
-    <char id="213" x="226" y="0" width="16" height="21" xoffset="1" yoffset="0" xadvance="18" />
-    <char id="214" x="467" y="0" width="16" height="20" xoffset="1" yoffset="1" xadvance="18" />
-    <char id="215" x="994" y="18" width="9" height="9" xoffset="2" yoffset="8" xadvance="13" />
-    <char id="216" x="542" y="0" width="17" height="18" xoffset="1" yoffset="4" xadvance="18" />
-    <char id="217" x="350" y="0" width="13" height="21" xoffset="2" yoffset="0" xadvance="17" />
-    <char id="218" x="336" y="0" width="13" height="21" xoffset="2" yoffset="0" xadvance="17" />
-    <char id="219" x="322" y="0" width="13" height="21" xoffset="2" yoffset="0" xadvance="17" />
-    <char id="220" x="484" y="0" width="13" height="20" xoffset="2" yoffset="1" xadvance="17" />
-    <char id="221" x="293" y="0" width="14" height="21" xoffset="0" yoffset="0" xadvance="15" />
-    <char id="222" x="137" y="22" width="12" height="17" xoffset="2" yoffset="4" xadvance="15" />
-    <char id="223" x="150" y="22" width="12" height="17" xoffset="2" yoffset="4" xadvance="14" />
-    <char id="224" x="297" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="225" x="309" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="226" x="321" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="227" x="333" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="228" x="675" y="18" width="11" height="16" xoffset="1" yoffset="5" xadvance="13" />
-    <char id="229" x="530" y="0" width="11" height="19" xoffset="1" yoffset="2" xadvance="13" />
-    <char id="230" x="733" y="18" width="19" height="13" xoffset="1" yoffset="8" xadvance="20" />
-    <char id="231" x="488" y="21" width="10" height="17" xoffset="1" yoffset="8" xadvance="12" />
-    <char id="232" x="465" y="21" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="233" x="357" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="234" x="369" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="235" x="663" y="18" width="11" height="16" xoffset="1" yoffset="5" xadvance="13" />
-    <char id="236" x="627" y="19" width="4" height="17" xoffset="1" yoffset="4" xadvance="6" />
-    <char id="237" x="632" y="19" width="4" height="17" xoffset="1" yoffset="4" xadvance="6" />
-    <char id="238" x="586" y="19" width="8" height="17" xoffset="-1" yoffset="4" xadvance="6" />
-    <char id="239" x="710" y="18" width="6" height="16" xoffset="0" yoffset="5" xadvance="6" />
-    <char id="240" x="381" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="241" x="510" y="21" width="10" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="242" x="393" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="243" x="405" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="244" x="417" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="245" x="429" y="22" width="11" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="246" x="687" y="18" width="11" height="16" xoffset="1" yoffset="5" xadvance="13" />
-    <char id="247" x="1004" y="18" width="12" height="8" xoffset="1" yoffset="9" xadvance="13" />
-    <char id="248" x="649" y="19" width="13" height="16" xoffset="0" yoffset="6" xadvance="13" />
-    <char id="249" x="532" y="20" width="10" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="250" x="521" y="21" width="10" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="251" x="499" y="21" width="10" height="17" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="252" x="699" y="18" width="10" height="16" xoffset="1" yoffset="5" xadvance="13" />
-    <char id="253" x="22" y="0" width="13" height="22" xoffset="-1" yoffset="4" xadvance="12" />
-    <char id="254" x="36" y="0" width="11" height="22" xoffset="1" yoffset="4" xadvance="13" />
-    <char id="255" x="308" y="0" width="13" height="21" xoffset="-1" yoffset="5" xadvance="12" />
-  </chars>
-  <kernings count="70">
-    <kerning first="32" second="65" amount="-1" />
-    <kerning first="49" second="49" amount="-2" />
-    <kerning first="65" second="32" amount="-1" />
-    <kerning first="65" second="84" amount="-2" />
-    <kerning first="65" second="86" amount="-2" />
-    <kerning first="65" second="87" amount="-1" />
-    <kerning first="65" second="89" amount="-2" />
-    <kerning first="70" second="44" amount="-3" />
-    <kerning first="70" second="46" amount="-3" />
-    <kerning first="70" second="65" amount="-1" />
-    <kerning first="76" second="32" amount="-1" />
-    <kerning first="76" second="84" amount="-2" />
-    <kerning first="76" second="86" amount="-2" />
-    <kerning first="76" second="87" amount="-2" />
-    <kerning first="76" second="89" amount="-2" />
-    <kerning first="76" second="121" amount="-1" />
-    <kerning first="80" second="44" amount="-3" />
-    <kerning first="80" second="46" amount="-3" />
-    <kerning first="80" second="65" amount="-2" />
-    <kerning first="84" second="44" amount="-3" />
-    <kerning first="84" second="45" amount="-1" />
-    <kerning first="84" second="46" amount="-3" />
-    <kerning first="84" second="58" amount="-3" />
-    <kerning first="84" second="65" amount="-2" />
-    <kerning first="84" second="97" amount="-3" />
-    <kerning first="84" second="99" amount="-3" />
-    <kerning first="84" second="101" amount="-3" />
-    <kerning first="84" second="105" amount="-1" />
-    <kerning first="84" second="111" amount="-3" />
-    <kerning first="84" second="114" amount="-1" />
-    <kerning first="84" second="115" amount="-3" />
-    <kerning first="84" second="117" amount="-1" />
-    <kerning first="84" second="119" amount="-1" />
-    <kerning first="84" second="121" amount="-1" />
-    <kerning first="86" second="44" amount="-2" />
-    <kerning first="86" second="45" amount="-1" />
-    <kerning first="86" second="46" amount="-2" />
-    <kerning first="86" second="58" amount="-1" />
-    <kerning first="86" second="65" amount="-2" />
-    <kerning first="86" second="97" amount="-2" />
-    <kerning first="86" second="101" amount="-1" />
-    <kerning first="86" second="111" amount="-1" />
-    <kerning first="86" second="114" amount="-1" />
-    <kerning first="86" second="117" amount="-1" />
-    <kerning first="86" second="121" amount="-1" />
-    <kerning first="87" second="44" amount="-1" />
-    <kerning first="87" second="46" amount="-1" />
-    <kerning first="87" second="65" amount="-1" />
-    <kerning first="87" second="97" amount="-1" />
-    <kerning first="89" second="44" amount="-3" />
-    <kerning first="89" second="45" amount="-2" />
-    <kerning first="89" second="46" amount="-3" />
-    <kerning first="89" second="58" amount="-1" />
-    <kerning first="89" second="65" amount="-2" />
-    <kerning first="89" second="97" amount="-2" />
-    <kerning first="89" second="101" amount="-2" />
-    <kerning first="89" second="105" amount="-1" />
-    <kerning first="89" second="111" amount="-2" />
-    <kerning first="89" second="112" amount="-2" />
-    <kerning first="89" second="113" amount="-2" />
-    <kerning first="89" second="117" amount="-1" />
-    <kerning first="89" second="118" amount="-1" />
-    <kerning first="114" second="44" amount="-1" />
-    <kerning first="114" second="46" amount="-1" />
-    <kerning first="118" second="44" amount="-2" />
-    <kerning first="118" second="46" amount="-2" />
-    <kerning first="119" second="44" amount="-1" />
-    <kerning first="119" second="46" amount="-1" />
-    <kerning first="121" second="44" amount="-2" />
-    <kerning first="121" second="46" amount="-2" />
-  </kernings>
-</font>

BIN
Samples/assets/Arial_0.tga


+ 0 - 28
Samples/assets/bitmapfont.rml

@@ -1,28 +0,0 @@
-<rml>
-	<head>
-		<title>Demo</title>
-		<link type="text/template" href="window.rml" />
-		<style>
-			body
-			{
-				width: 300px;
-				height: 225px;
-				font-family: Arial;
-				margin: auto;
-			}
-			
-			div#title_bar div#icon
-			{
-				display: none;
-			}
-			
-			div#content
-			{
-				text-align: left;
-			}
-		</style>
-	</head>
-	<body template="window">
-		This is a bitmap font<br/>sample.
-	</body>
-</rml>

+ 758 - 0
Samples/basic/bitmapfont/data/Comfortaa_Regular_22.fnt

@@ -0,0 +1,758 @@
+<?xml version="1.0"?>
+<font>
+  <info face="Comfortaa" size="22" bold="0" italic="0" charset="" unicode="1" stretchH="100" smooth="1" aa="2" padding="0,0,0,0" spacing="2,2" outline="0"/>
+  <common lineHeight="22" base="18" scaleW="256" scaleH="128" pages="1" packed="0" alphaChnl="0" redChnl="4" greenChnl="4" blueChnl="4"/>
+  <pages>
+    <page id="0" file="Comfortaa_Regular_22.tga" />
+  </pages>
+  <chars count="191">
+    <char id="32" x="253" y="67" width="1" height="1" xoffset="0" yoffset="0" xadvance="4" page="0" chnl="15" />
+    <char id="33" x="159" y="86" width="3" height="14" xoffset="0" yoffset="3" xadvance="4" page="0" chnl="15" />
+    <char id="34" x="227" y="113" width="4" height="5" xoffset="0" yoffset="2" xadvance="5" page="0" chnl="15" />
+    <char id="35" x="176" y="54" width="10" height="14" xoffset="1" yoffset="3" xadvance="12" page="0" chnl="15" />
+    <char id="36" x="182" y="0" width="8" height="18" xoffset="0" yoffset="1" xadvance="9" page="0" chnl="15" />
+    <char id="37" x="239" y="19" width="14" height="14" xoffset="0" yoffset="3" xadvance="15" page="0" chnl="15" />
+    <char id="38" x="126" y="39" width="12" height="14" xoffset="0" yoffset="3" xadvance="13" page="0" chnl="15" />
+    <char id="39" x="251" y="110" width="2" height="5" xoffset="0" yoffset="2" xadvance="3" page="0" chnl="15" />
+    <char id="40" x="0" y="0" width="4" height="20" xoffset="2" yoffset="2" xadvance="7" page="0" chnl="15" />
+    <char id="41" x="6" y="0" width="4" height="20" xoffset="0" yoffset="2" xadvance="7" page="0" chnl="15" />
+    <char id="42" x="205" y="113" width="6" height="6" xoffset="2" yoffset="2" xadvance="9" page="0" chnl="15" />
+    <char id="43" x="102" y="115" width="8" height="8" xoffset="1" yoffset="6" xadvance="9" page="0" chnl="15" />
+    <char id="44" x="245" y="111" width="4" height="5" xoffset="0" yoffset="14" xadvance="5" page="0" chnl="15" />
+    <char id="45" x="35" y="119" width="6" height="3" xoffset="0" yoffset="11" xadvance="6" page="0" chnl="15" />
+    <char id="46" x="51" y="118" width="3" height="3" xoffset="1" yoffset="14" xadvance="5" page="0" chnl="15" />
+    <char id="47" x="205" y="20" width="7" height="16" xoffset="0" yoffset="3" xadvance="7" page="0" chnl="15" />
+    <char id="48" x="85" y="87" width="8" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="49" x="248" y="51" width="4" height="14" xoffset="0" yoffset="3" xadvance="5" page="0" chnl="15" />
+    <char id="50" x="209" y="70" width="9" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="51" x="65" y="87" width="8" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="52" x="65" y="55" width="11" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="53" x="220" y="70" width="9" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="54" x="75" y="87" width="8" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="55" x="143" y="70" width="9" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="56" x="105" y="87" width="8" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="57" x="95" y="87" width="8" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="58" x="250" y="98" width="3" height="10" xoffset="1" yoffset="8" xadvance="5" page="0" chnl="15" />
+    <char id="59" x="47" y="105" width="3" height="11" xoffset="1" yoffset="8" xadvance="5" page="0" chnl="15" />
+    <char id="60" x="72" y="115" width="8" height="10" xoffset="1" yoffset="7" xadvance="9" page="0" chnl="15" />
+    <char id="61" x="185" y="113" width="8" height="6" xoffset="1" yoffset="9" xadvance="9" page="0" chnl="15" />
+    <char id="62" x="240" y="99" width="8" height="10" xoffset="1" yoffset="6" xadvance="9" page="0" chnl="15" />
+    <char id="63" x="231" y="68" width="9" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="64" x="35" y="0" width="18" height="18" xoffset="0" yoffset="2" xadvance="18" page="0" chnl="15" />
+    <char id="65" x="78" y="55" width="11" height="14" xoffset="0" yoffset="3" xadvance="11" page="0" chnl="15" />
+    <char id="66" x="11" y="89" width="9" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="67" x="154" y="38" width="12" height="14" xoffset="0" yoffset="3" xadvance="12" page="0" chnl="15" />
+    <char id="68" x="196" y="38" width="11" height="14" xoffset="0" yoffset="3" xadvance="11" page="0" chnl="15" />
+    <char id="69" x="108" y="71" width="10" height="14" xoffset="0" yoffset="3" xadvance="10" page="0" chnl="15" />
+    <char id="70" x="96" y="71" width="10" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="71" x="140" y="38" width="12" height="14" xoffset="0" yoffset="3" xadvance="12" page="0" chnl="15" />
+    <char id="72" x="12" y="73" width="10" height="14" xoffset="0" yoffset="3" xadvance="11" page="0" chnl="15" />
+    <char id="73" x="153" y="86" width="4" height="14" xoffset="0" yoffset="3" xadvance="5" page="0" chnl="15" />
+    <char id="74" x="22" y="89" width="9" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="75" x="104" y="55" width="10" height="14" xoffset="0" yoffset="3" xadvance="10" page="0" chnl="15" />
+    <char id="76" x="33" y="89" width="9" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="77" x="96" y="39" width="13" height="14" xoffset="0" yoffset="3" xadvance="14" page="0" chnl="15" />
+    <char id="78" x="39" y="56" width="11" height="14" xoffset="0" yoffset="3" xadvance="12" page="0" chnl="15" />
+    <char id="79" x="80" y="39" width="14" height="14" xoffset="0" yoffset="3" xadvance="15" page="0" chnl="15" />
+    <char id="80" x="115" y="87" width="8" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="81" x="48" y="39" width="14" height="14" xoffset="0" yoffset="3" xadvance="15" page="0" chnl="15" />
+    <char id="82" x="44" y="89" width="9" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="83" x="125" y="87" width="8" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="84" x="209" y="38" width="11" height="14" xoffset="0" yoffset="3" xadvance="11" page="0" chnl="15" />
+    <char id="85" x="0" y="73" width="10" height="14" xoffset="0" yoffset="3" xadvance="11" page="0" chnl="15" />
+    <char id="86" x="222" y="36" width="11" height="14" xoffset="0" yoffset="3" xadvance="11" page="0" chnl="15" />
+    <char id="87" x="221" y="20" width="16" height="14" xoffset="0" yoffset="3" xadvance="16" page="0" chnl="15" />
+    <char id="88" x="235" y="36" width="11" height="14" xoffset="0" yoffset="3" xadvance="12" page="0" chnl="15" />
+    <char id="89" x="0" y="57" width="11" height="14" xoffset="0" yoffset="3" xadvance="10" page="0" chnl="15" />
+    <char id="90" x="13" y="57" width="11" height="14" xoffset="0" yoffset="3" xadvance="12" page="0" chnl="15" />
+    <char id="91" x="20" y="0" width="6" height="19" xoffset="2" yoffset="2" xadvance="7" page="0" chnl="15" />
+    <char id="92" x="196" y="20" width="7" height="16" xoffset="0" yoffset="2" xadvance="6" page="0" chnl="15" />
+    <char id="93" x="28" y="0" width="5" height="19" xoffset="0" yoffset="2" xadvance="7" page="0" chnl="15" />
+    <char id="94" x="129" y="115" width="7" height="7" xoffset="0" yoffset="3" xadvance="8" page="0" chnl="15" />
+    <char id="95" x="56" y="117" width="10" height="2" xoffset="0" yoffset="17" xadvance="9" page="0" chnl="15" />
+    <char id="96" x="239" y="113" width="4" height="5" xoffset="1" yoffset="4" xadvance="7" page="0" chnl="15" />
+    <char id="97" x="139" y="103" width="10" height="10" xoffset="0" yoffset="7" xadvance="11" page="0" chnl="15" />
+    <char id="98" x="26" y="57" width="11" height="14" xoffset="0" yoffset="3" xadvance="11" page="0" chnl="15" />
+    <char id="99" x="187" y="101" width="9" height="10" xoffset="0" yoffset="7" xadvance="9" page="0" chnl="15" />
+    <char id="100" x="52" y="55" width="11" height="14" xoffset="0" yoffset="3" xadvance="11" page="0" chnl="15" />
+    <char id="101" x="103" y="103" width="10" height="10" xoffset="0" yoffset="7" xadvance="11" page="0" chnl="15" />
+    <char id="102" x="135" y="87" width="7" height="14" xoffset="0" yoffset="3" xadvance="8" page="0" chnl="15" />
+    <char id="103" x="236" y="52" width="10" height="14" xoffset="0" yoffset="7" xadvance="11" page="0" chnl="15" />
+    <char id="104" x="116" y="55" width="10" height="14" xoffset="0" yoffset="3" xadvance="11" page="0" chnl="15" />
+    <char id="105" x="237" y="84" width="2" height="13" xoffset="0" yoffset="5" xadvance="4" page="0" chnl="15" />
+    <char id="106" x="130" y="20" width="5" height="17" xoffset="0" yoffset="5" xadvance="6" page="0" chnl="15" />
+    <char id="107" x="132" y="71" width="9" height="14" xoffset="0" yoffset="3" xadvance="10" page="0" chnl="15" />
+    <char id="108" x="248" y="35" width="4" height="14" xoffset="0" yoffset="4" xadvance="4" page="0" chnl="15" />
+    <char id="109" x="72" y="103" width="15" height="10" xoffset="0" yoffset="7" xadvance="16" page="0" chnl="15" />
+    <char id="110" x="115" y="103" width="10" height="10" xoffset="0" yoffset="7" xadvance="11" page="0" chnl="15" />
+    <char id="111" x="127" y="103" width="10" height="10" xoffset="0" yoffset="7" xadvance="11" page="0" chnl="15" />
+    <char id="112" x="212" y="54" width="10" height="14" xoffset="0" yoffset="7" xadvance="11" page="0" chnl="15" />
+    <char id="113" x="224" y="52" width="10" height="14" xoffset="0" yoffset="7" xadvance="11" page="0" chnl="15" />
+    <char id="114" x="230" y="101" width="8" height="10" xoffset="0" yoffset="7" xadvance="8" page="0" chnl="15" />
+    <char id="115" x="82" y="115" width="8" height="10" xoffset="0" yoffset="7" xadvance="9" page="0" chnl="15" />
+    <char id="116" x="144" y="86" width="7" height="14" xoffset="0" yoffset="4" xadvance="6" page="0" chnl="15" />
+    <char id="117" x="151" y="102" width="10" height="10" xoffset="0" yoffset="7" xadvance="11" page="0" chnl="15" />
+    <char id="118" x="163" y="102" width="10" height="10" xoffset="0" yoffset="7" xadvance="10" page="0" chnl="15" />
+    <char id="119" x="89" y="103" width="12" height="10" xoffset="0" yoffset="7" xadvance="13" page="0" chnl="15" />
+    <char id="120" x="209" y="101" width="9" height="10" xoffset="0" yoffset="7" xadvance="9" page="0" chnl="15" />
+    <char id="121" x="199" y="86" width="8" height="13" xoffset="0" yoffset="7" xadvance="8" page="0" chnl="15" />
+    <char id="122" x="198" y="101" width="9" height="10" xoffset="0" yoffset="7" xadvance="9" page="0" chnl="15" />
+    <char id="123" x="210" y="0" width="6" height="18" xoffset="2" yoffset="2" xadvance="9" page="0" chnl="15" />
+    <char id="124" x="16" y="0" width="2" height="20" xoffset="3" yoffset="2" xadvance="9" page="0" chnl="15" />
+    <char id="125" x="192" y="0" width="7" height="18" xoffset="0" yoffset="2" xadvance="9" page="0" chnl="15" />
+    <char id="126" x="0" y="119" width="7" height="4" xoffset="1" yoffset="9" xadvance="9" page="0" chnl="15" />
+    <char id="160" x="253" y="0" width="1" height="1" xoffset="0" yoffset="0" xadvance="4" page="0" chnl="15" />
+    <char id="161" x="232" y="84" width="3" height="13" xoffset="1" yoffset="4" xadvance="6" page="0" chnl="15" />
+    <char id="162" x="175" y="20" width="9" height="16" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="163" x="55" y="88" width="8" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="164" x="138" y="115" width="7" height="7" xoffset="1" yoffset="7" xadvance="9" page="0" chnl="15" />
+    <char id="165" x="241" y="84" width="11" height="12" xoffset="0" yoffset="5" xadvance="11" page="0" chnl="15" />
+    <char id="166" x="12" y="0" width="2" height="20" xoffset="2" yoffset="2" xadvance="7" page="0" chnl="15" />
+    <char id="167" x="201" y="0" width="7" height="18" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="168" x="26" y="119" width="7" height="3" xoffset="1" yoffset="5" xadvance="9" page="0" chnl="15" />
+    <char id="169" x="0" y="41" width="14" height="14" xoffset="0" yoffset="3" xadvance="15" page="0" chnl="15" />
+    <char id="170" x="213" y="113" width="6" height="6" xoffset="0" yoffset="4" xadvance="6" page="0" chnl="15" />
+    <char id="171" x="163" y="114" width="6" height="7" xoffset="2" yoffset="9" xadvance="9" page="0" chnl="15" />
+    <char id="172" x="195" y="113" width="8" height="6" xoffset="0" yoffset="10" xadvance="9" page="0" chnl="15" />
+    <char id="173" x="43" y="119" width="6" height="3" xoffset="0" yoffset="11" xadvance="6" page="0" chnl="15" />
+    <char id="174" x="16" y="41" width="14" height="14" xoffset="0" yoffset="3" xadvance="15" page="0" chnl="15" />
+    <char id="175" x="14" y="119" width="10" height="3" xoffset="-1" yoffset="0" xadvance="7" page="0" chnl="15" />
+    <char id="176" x="147" y="115" width="6" height="7" xoffset="0" yoffset="3" xadvance="6" page="0" chnl="15" />
+    <char id="177" x="220" y="101" width="8" height="10" xoffset="1" yoffset="6" xadvance="9" page="0" chnl="15" />
+    <char id="178" x="112" y="115" width="5" height="8" xoffset="2" yoffset="2" xadvance="9" page="0" chnl="15" />
+    <char id="179" x="119" y="115" width="4" height="8" xoffset="2" yoffset="2" xadvance="9" page="0" chnl="15" />
+    <char id="180" x="233" y="113" width="4" height="5" xoffset="2" yoffset="4" xadvance="8" page="0" chnl="15" />
+    <char id="181" x="36" y="73" width="10" height="14" xoffset="0" yoffset="7" xadvance="11" page="0" chnl="15" />
+    <char id="182" x="154" y="70" width="9" height="14" xoffset="0" yoffset="3" xadvance="9" page="0" chnl="15" />
+    <char id="183" x="9" y="119" width="3" height="4" xoffset="1" yoffset="10" xadvance="4" page="0" chnl="15" />
+    <char id="184" x="221" y="113" width="4" height="5" xoffset="3" yoffset="16" xadvance="9" page="0" chnl="15" />
+    <char id="185" x="125" y="115" width="2" height="8" xoffset="3" yoffset="2" xadvance="9" page="0" chnl="15" />
+    <char id="186" x="179" y="113" width="4" height="7" xoffset="1" yoffset="2" xadvance="6" page="0" chnl="15" />
+    <char id="187" x="171" y="114" width="6" height="7" xoffset="1" yoffset="9" xadvance="9" page="0" chnl="15" />
+    <char id="188" x="182" y="38" width="12" height="14" xoffset="1" yoffset="3" xadvance="14" page="0" chnl="15" />
+    <char id="189" x="168" y="38" width="12" height="14" xoffset="0" yoffset="3" xadvance="14" page="0" chnl="15" />
+    <char id="190" x="111" y="39" width="13" height="14" xoffset="0" yoffset="3" xadvance="14" page="0" chnl="15" />
+    <char id="191" x="165" y="70" width="9" height="14" xoffset="0" yoffset="7" xadvance="9" page="0" chnl="15" />
+    <char id="192" x="58" y="20" width="11" height="17" xoffset="0" yoffset="0" xadvance="11" page="0" chnl="15" />
+    <char id="193" x="71" y="20" width="11" height="17" xoffset="0" yoffset="0" xadvance="11" page="0" chnl="15" />
+    <char id="194" x="32" y="21" width="11" height="17" xoffset="0" yoffset="0" xadvance="11" page="0" chnl="15" />
+    <char id="195" x="150" y="20" width="11" height="16" xoffset="0" yoffset="1" xadvance="11" page="0" chnl="15" />
+    <char id="196" x="137" y="20" width="11" height="16" xoffset="0" yoffset="1" xadvance="11" page="0" chnl="15" />
+    <char id="197" x="87" y="0" width="11" height="18" xoffset="0" yoffset="0" xadvance="11" page="0" chnl="15" />
+    <char id="198" x="32" y="40" width="14" height="14" xoffset="0" yoffset="3" xadvance="14" page="0" chnl="15" />
+    <char id="199" x="100" y="0" width="11" height="18" xoffset="0" yoffset="3" xadvance="13" page="0" chnl="15" />
+    <char id="200" x="160" y="0" width="9" height="18" xoffset="0" yoffset="0" xadvance="9" page="0" chnl="15" />
+    <char id="201" x="149" y="0" width="9" height="18" xoffset="0" yoffset="0" xadvance="9" page="0" chnl="15" />
+    <char id="202" x="108" y="20" width="9" height="17" xoffset="0" yoffset="0" xadvance="9" page="0" chnl="15" />
+    <char id="203" x="119" y="20" width="9" height="17" xoffset="0" yoffset="1" xadvance="9" page="0" chnl="15" />
+    <char id="204" x="218" y="0" width="4" height="18" xoffset="1" yoffset="0" xadvance="6" page="0" chnl="15" />
+    <char id="205" x="224" y="0" width="4" height="18" xoffset="1" yoffset="0" xadvance="6" page="0" chnl="15" />
+    <char id="206" x="246" y="0" width="5" height="17" xoffset="0" yoffset="0" xadvance="6" page="0" chnl="15" />
+    <char id="207" x="214" y="20" width="5" height="16" xoffset="0" yoffset="1" xadvance="6" page="0" chnl="15" />
+    <char id="208" x="91" y="55" width="11" height="14" xoffset="0" yoffset="3" xadvance="12" page="0" chnl="15" />
+    <char id="209" x="45" y="20" width="11" height="17" xoffset="0" yoffset="1" xadvance="12" page="0" chnl="15" />
+    <char id="210" x="55" y="0" width="14" height="18" xoffset="0" yoffset="0" xadvance="14" page="0" chnl="15" />
+    <char id="211" x="71" y="0" width="14" height="18" xoffset="0" yoffset="0" xadvance="14" page="0" chnl="15" />
+    <char id="212" x="230" y="0" width="14" height="17" xoffset="0" yoffset="0" xadvance="14" page="0" chnl="15" />
+    <char id="213" x="0" y="22" width="14" height="17" xoffset="0" yoffset="0" xadvance="14" page="0" chnl="15" />
+    <char id="214" x="16" y="22" width="14" height="17" xoffset="0" yoffset="1" xadvance="14" page="0" chnl="15" />
+    <char id="215" x="155" y="114" width="6" height="7" xoffset="2" yoffset="8" xadvance="9" page="0" chnl="15" />
+    <char id="216" x="64" y="39" width="14" height="14" xoffset="0" yoffset="3" xadvance="15" page="0" chnl="15" />
+    <char id="217" x="113" y="0" width="10" height="18" xoffset="0" yoffset="0" xadvance="10" page="0" chnl="15" />
+    <char id="218" x="137" y="0" width="10" height="18" xoffset="0" yoffset="0" xadvance="10" page="0" chnl="15" />
+    <char id="219" x="96" y="20" width="10" height="17" xoffset="0" yoffset="0" xadvance="10" page="0" chnl="15" />
+    <char id="220" x="163" y="20" width="10" height="16" xoffset="0" yoffset="1" xadvance="10" page="0" chnl="15" />
+    <char id="221" x="84" y="20" width="10" height="17" xoffset="0" yoffset="0" xadvance="10" page="0" chnl="15" />
+    <char id="222" x="176" y="70" width="9" height="14" xoffset="0" yoffset="3" xadvance="10" page="0" chnl="15" />
+    <char id="223" x="187" y="70" width="9" height="14" xoffset="0" yoffset="3" xadvance="10" page="0" chnl="15" />
+    <char id="224" x="128" y="55" width="10" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="225" x="140" y="54" width="10" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="226" x="24" y="73" width="10" height="14" xoffset="0" yoffset="4" xadvance="11" page="0" chnl="15" />
+    <char id="227" x="164" y="86" width="10" height="13" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="228" x="0" y="105" width="10" height="12" xoffset="0" yoffset="5" xadvance="10" page="0" chnl="15" />
+    <char id="229" x="152" y="54" width="10" height="14" xoffset="0" yoffset="3" xadvance="10" page="0" chnl="15" />
+    <char id="230" x="52" y="105" width="18" height="10" xoffset="0" yoffset="7" xadvance="18" page="0" chnl="15" />
+    <char id="231" x="198" y="70" width="9" height="14" xoffset="0" yoffset="7" xadvance="9" page="0" chnl="15" />
+    <char id="232" x="120" y="71" width="10" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="233" x="164" y="54" width="10" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="234" x="188" y="54" width="10" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="235" x="12" y="105" width="10" height="12" xoffset="0" yoffset="5" xadvance="10" page="0" chnl="15" />
+    <char id="236" x="222" y="86" width="3" height="13" xoffset="0" yoffset="4" xadvance="5" page="0" chnl="15" />
+    <char id="237" x="227" y="86" width="3" height="13" xoffset="1" yoffset="4" xadvance="5" page="0" chnl="15" />
+    <char id="238" x="216" y="86" width="4" height="13" xoffset="0" yoffset="4" xadvance="5" page="0" chnl="15" />
+    <char id="239" x="209" y="86" width="5" height="13" xoffset="0" yoffset="5" xadvance="5" page="0" chnl="15" />
+    <char id="240" x="200" y="54" width="10" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="241" x="188" y="86" width="9" height="13" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="242" x="48" y="72" width="10" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="243" x="60" y="71" width="10" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="244" x="72" y="71" width="10" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="245" x="176" y="86" width="10" height="13" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="246" x="24" y="105" width="10" height="12" xoffset="0" yoffset="5" xadvance="10" page="0" chnl="15" />
+    <char id="247" x="92" y="115" width="8" height="9" xoffset="1" yoffset="6" xadvance="9" page="0" chnl="15" />
+    <char id="248" x="175" y="101" width="10" height="10" xoffset="0" yoffset="7" xadvance="11" page="0" chnl="15" />
+    <char id="249" x="242" y="68" width="9" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="250" x="0" y="89" width="9" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="251" x="84" y="71" width="10" height="14" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="252" x="36" y="105" width="9" height="12" xoffset="0" yoffset="5" xadvance="10" page="0" chnl="15" />
+    <char id="253" x="171" y="0" width="9" height="18" xoffset="0" yoffset="4" xadvance="9" page="0" chnl="15" />
+    <char id="254" x="125" y="0" width="10" height="18" xoffset="0" yoffset="4" xadvance="10" page="0" chnl="15" />
+    <char id="255" x="186" y="20" width="8" height="16" xoffset="0" yoffset="5" xadvance="9" page="0" chnl="15" />
+  </chars>
+  <kernings count="555">
+    <kerning first="65" second="84" amount="-1" />
+    <kerning first="65" second="86" amount="-2" />
+    <kerning first="65" second="87" amount="-1" />
+    <kerning first="65" second="89" amount="-1" />
+    <kerning first="65" second="106" amount="-2" />
+    <kerning first="65" second="116" amount="-1" />
+    <kerning first="65" second="221" amount="-1" />
+    <kerning first="66" second="106" amount="-2" />
+    <kerning first="67" second="102" amount="-1" />
+    <kerning first="67" second="106" amount="-2" />
+    <kerning first="67" second="118" amount="-1" />
+    <kerning first="67" second="121" amount="-1" />
+    <kerning first="67" second="253" amount="-1" />
+    <kerning first="255" second="221" amount="-1" />
+    <kerning first="68" second="84" amount="-1" />
+    <kerning first="68" second="106" amount="-2" />
+    <kerning first="69" second="106" amount="-2" />
+    <kerning first="69" second="118" amount="-1" />
+    <kerning first="69" second="121" amount="-1" />
+    <kerning first="69" second="253" amount="-1" />
+    <kerning first="70" second="65" amount="-2" />
+    <kerning first="70" second="74" amount="-1" />
+    <kerning first="70" second="106" amount="-2" />
+    <kerning first="255" second="198" amount="-1" />
+    <kerning first="70" second="192" amount="-2" />
+    <kerning first="70" second="193" amount="-1" />
+    <kerning first="70" second="194" amount="-2" />
+    <kerning first="70" second="195" amount="-1" />
+    <kerning first="70" second="196" amount="-2" />
+    <kerning first="70" second="197" amount="-2" />
+    <kerning first="70" second="198" amount="-2" />
+    <kerning first="71" second="106" amount="-2" />
+    <kerning first="72" second="106" amount="-1" />
+    <kerning first="73" second="106" amount="-2" />
+    <kerning first="74" second="106" amount="-1" />
+    <kerning first="75" second="106" amount="-1" />
+    <kerning first="75" second="118" amount="-1" />
+    <kerning first="255" second="197" amount="-1" />
+    <kerning first="75" second="199" amount="-1" />
+    <kerning first="75" second="253" amount="-1" />
+    <kerning first="75" second="255" amount="-1" />
+    <kerning first="76" second="67" amount="-1" />
+    <kerning first="76" second="71" amount="-1" />
+    <kerning first="76" second="79" amount="-1" />
+    <kerning first="76" second="81" amount="-1" />
+    <kerning first="76" second="84" amount="-3" />
+    <kerning first="76" second="86" amount="-2" />
+    <kerning first="76" second="87" amount="-2" />
+    <kerning first="76" second="89" amount="-3" />
+    <kerning first="76" second="106" amount="-2" />
+    <kerning first="76" second="118" amount="-2" />
+    <kerning first="76" second="121" amount="-1" />
+    <kerning first="76" second="199" amount="-1" />
+    <kerning first="76" second="210" amount="-1" />
+    <kerning first="76" second="211" amount="-1" />
+    <kerning first="76" second="212" amount="-2" />
+    <kerning first="76" second="213" amount="-1" />
+    <kerning first="76" second="214" amount="-2" />
+    <kerning first="76" second="221" amount="-2" />
+    <kerning first="76" second="253" amount="-1" />
+    <kerning first="76" second="255" amount="-1" />
+    <kerning first="77" second="106" amount="-2" />
+    <kerning first="78" second="106" amount="-1" />
+    <kerning first="79" second="84" amount="-1" />
+    <kerning first="79" second="106" amount="-2" />
+    <kerning first="80" second="65" amount="-2" />
+    <kerning first="80" second="74" amount="-1" />
+    <kerning first="80" second="106" amount="-2" />
+    <kerning first="80" second="192" amount="-2" />
+    <kerning first="80" second="193" amount="-2" />
+    <kerning first="80" second="194" amount="-2" />
+    <kerning first="80" second="195" amount="-2" />
+    <kerning first="80" second="196" amount="-2" />
+    <kerning first="80" second="197" amount="-2" />
+    <kerning first="80" second="198" amount="-3" />
+    <kerning first="81" second="84" amount="-1" />
+    <kerning first="81" second="106" amount="-1" />
+    <kerning first="82" second="106" amount="-1" />
+    <kerning first="83" second="106" amount="-1" />
+    <kerning first="84" second="65" amount="-3" />
+    <kerning first="84" second="67" amount="-2" />
+    <kerning first="84" second="71" amount="-1" />
+    <kerning first="84" second="74" amount="-2" />
+    <kerning first="84" second="79" amount="-1" />
+    <kerning first="84" second="81" amount="-1" />
+    <kerning first="84" second="97" amount="-2" />
+    <kerning first="84" second="99" amount="-3" />
+    <kerning first="84" second="100" amount="-2" />
+    <kerning first="84" second="101" amount="-2" />
+    <kerning first="84" second="102" amount="-2" />
+    <kerning first="84" second="103" amount="-2" />
+    <kerning first="84" second="106" amount="-2" />
+    <kerning first="84" second="109" amount="-2" />
+    <kerning first="84" second="110" amount="-2" />
+    <kerning first="84" second="111" amount="-2" />
+    <kerning first="84" second="112" amount="-2" />
+    <kerning first="84" second="113" amount="-2" />
+    <kerning first="84" second="114" amount="-1" />
+    <kerning first="84" second="115" amount="-1" />
+    <kerning first="84" second="117" amount="-1" />
+    <kerning first="84" second="118" amount="-1" />
+    <kerning first="84" second="119" amount="-1" />
+    <kerning first="84" second="120" amount="-1" />
+    <kerning first="84" second="121" amount="-1" />
+    <kerning first="84" second="122" amount="-1" />
+    <kerning first="84" second="192" amount="-1" />
+    <kerning first="84" second="193" amount="-1" />
+    <kerning first="84" second="194" amount="-1" />
+    <kerning first="84" second="195" amount="-2" />
+    <kerning first="84" second="196" amount="-1" />
+    <kerning first="84" second="197" amount="-2" />
+    <kerning first="84" second="198" amount="-2" />
+    <kerning first="84" second="199" amount="-1" />
+    <kerning first="84" second="210" amount="-1" />
+    <kerning first="84" second="211" amount="-1" />
+    <kerning first="84" second="212" amount="-1" />
+    <kerning first="84" second="213" amount="-1" />
+    <kerning first="84" second="214" amount="-1" />
+    <kerning first="84" second="216" amount="-1" />
+    <kerning first="84" second="224" amount="-2" />
+    <kerning first="84" second="225" amount="-2" />
+    <kerning first="84" second="226" amount="-1" />
+    <kerning first="84" second="228" amount="-2" />
+    <kerning first="84" second="229" amount="-1" />
+    <kerning first="84" second="230" amount="-2" />
+    <kerning first="84" second="231" amount="-2" />
+    <kerning first="84" second="232" amount="-2" />
+    <kerning first="84" second="233" amount="-2" />
+    <kerning first="84" second="234" amount="-1" />
+    <kerning first="84" second="235" amount="-2" />
+    <kerning first="255" second="196" amount="-1" />
+    <kerning first="84" second="240" amount="-1" />
+    <kerning first="84" second="242" amount="-1" />
+    <kerning first="84" second="243" amount="-1" />
+    <kerning first="84" second="244" amount="-1" />
+    <kerning first="84" second="246" amount="-1" />
+    <kerning first="84" second="248" amount="-1" />
+    <kerning first="84" second="249" amount="-1" />
+    <kerning first="84" second="250" amount="-1" />
+    <kerning first="84" second="251" amount="-1" />
+    <kerning first="84" second="252" amount="-1" />
+    <kerning first="84" second="253" amount="-1" />
+    <kerning first="84" second="255" amount="-1" />
+    <kerning first="85" second="106" amount="-2" />
+    <kerning first="86" second="65" amount="-2" />
+    <kerning first="86" second="74" amount="-2" />
+    <kerning first="86" second="106" amount="-2" />
+    <kerning first="86" second="192" amount="-2" />
+    <kerning first="86" second="193" amount="-2" />
+    <kerning first="86" second="194" amount="-2" />
+    <kerning first="86" second="195" amount="-2" />
+    <kerning first="86" second="196" amount="-2" />
+    <kerning first="86" second="197" amount="-2" />
+    <kerning first="86" second="198" amount="-2" />
+    <kerning first="86" second="231" amount="-1" />
+    <kerning first="87" second="65" amount="-1" />
+    <kerning first="87" second="106" amount="-2" />
+    <kerning first="87" second="192" amount="-1" />
+    <kerning first="87" second="193" amount="-1" />
+    <kerning first="87" second="194" amount="-2" />
+    <kerning first="87" second="195" amount="-1" />
+    <kerning first="87" second="196" amount="-1" />
+    <kerning first="87" second="197" amount="-2" />
+    <kerning first="87" second="198" amount="-1" />
+    <kerning first="88" second="71" amount="-1" />
+    <kerning first="88" second="106" amount="-1" />
+    <kerning first="88" second="121" amount="-1" />
+    <kerning first="88" second="199" amount="-1" />
+    <kerning first="88" second="210" amount="-1" />
+    <kerning first="88" second="212" amount="-1" />
+    <kerning first="88" second="213" amount="-1" />
+    <kerning first="88" second="253" amount="-1" />
+    <kerning first="88" second="255" amount="-1" />
+    <kerning first="89" second="65" amount="-2" />
+    <kerning first="89" second="74" amount="-2" />
+    <kerning first="89" second="97" amount="-1" />
+    <kerning first="89" second="99" amount="-1" />
+    <kerning first="89" second="100" amount="-1" />
+    <kerning first="89" second="101" amount="-1" />
+    <kerning first="89" second="103" amount="-1" />
+    <kerning first="89" second="106" amount="-2" />
+    <kerning first="89" second="111" amount="-2" />
+    <kerning first="89" second="112" amount="-1" />
+    <kerning first="89" second="113" amount="-2" />
+    <kerning first="89" second="115" amount="-1" />
+    <kerning first="89" second="192" amount="-2" />
+    <kerning first="89" second="193" amount="-1" />
+    <kerning first="89" second="194" amount="-1" />
+    <kerning first="89" second="195" amount="-1" />
+    <kerning first="89" second="196" amount="-1" />
+    <kerning first="89" second="197" amount="-1" />
+    <kerning first="89" second="198" amount="-1" />
+    <kerning first="89" second="224" amount="-1" />
+    <kerning first="89" second="225" amount="-1" />
+    <kerning first="89" second="226" amount="-1" />
+    <kerning first="89" second="228" amount="-1" />
+    <kerning first="89" second="229" amount="-1" />
+    <kerning first="89" second="230" amount="-1" />
+    <kerning first="89" second="231" amount="-1" />
+    <kerning first="89" second="232" amount="-1" />
+    <kerning first="89" second="233" amount="-1" />
+    <kerning first="89" second="234" amount="-1" />
+    <kerning first="89" second="235" amount="-1" />
+    <kerning first="89" second="240" amount="-1" />
+    <kerning first="89" second="242" amount="-1" />
+    <kerning first="89" second="243" amount="-1" />
+    <kerning first="89" second="244" amount="-1" />
+    <kerning first="89" second="246" amount="-1" />
+    <kerning first="89" second="248" amount="-1" />
+    <kerning first="90" second="106" amount="-1" />
+    <kerning first="255" second="195" amount="-1" />
+    <kerning first="97" second="84" amount="-3" />
+    <kerning first="97" second="89" amount="-3" />
+    <kerning first="97" second="106" amount="-2" />
+    <kerning first="97" second="221" amount="-3" />
+    <kerning first="98" second="84" amount="-2" />
+    <kerning first="98" second="86" amount="-1" />
+    <kerning first="98" second="89" amount="-3" />
+    <kerning first="98" second="106" amount="-2" />
+    <kerning first="98" second="221" amount="-2" />
+    <kerning first="99" second="84" amount="-2" />
+    <kerning first="99" second="89" amount="-1" />
+    <kerning first="99" second="106" amount="-1" />
+    <kerning first="99" second="221" amount="-1" />
+    <kerning first="100" second="106" amount="-1" />
+    <kerning first="101" second="84" amount="-3" />
+    <kerning first="101" second="89" amount="-2" />
+    <kerning first="101" second="106" amount="-2" />
+    <kerning first="101" second="221" amount="-2" />
+    <kerning first="102" second="65" amount="-1" />
+    <kerning first="102" second="74" amount="-1" />
+    <kerning first="102" second="106" amount="-2" />
+    <kerning first="102" second="192" amount="-1" />
+    <kerning first="255" second="194" amount="-1" />
+    <kerning first="255" second="193" amount="-1" />
+    <kerning first="255" second="192" amount="-1" />
+    <kerning first="255" second="106" amount="-2" />
+    <kerning first="255" second="90" amount="-1" />
+    <kerning first="102" second="198" amount="-1" />
+    <kerning first="103" second="84" amount="-2" />
+    <kerning first="103" second="89" amount="-2" />
+    <kerning first="103" second="221" amount="-2" />
+    <kerning first="104" second="84" amount="-3" />
+    <kerning first="104" second="89" amount="-2" />
+    <kerning first="104" second="106" amount="-2" />
+    <kerning first="104" second="221" amount="-2" />
+    <kerning first="105" second="106" amount="-1" />
+    <kerning first="107" second="84" amount="-2" />
+    <kerning first="107" second="106" amount="-1" />
+    <kerning first="108" second="106" amount="-1" />
+    <kerning first="109" second="84" amount="-2" />
+    <kerning first="109" second="89" amount="-2" />
+    <kerning first="109" second="106" amount="-1" />
+    <kerning first="109" second="221" amount="-2" />
+    <kerning first="110" second="84" amount="-2" />
+    <kerning first="110" second="89" amount="-2" />
+    <kerning first="110" second="106" amount="-1" />
+    <kerning first="110" second="221" amount="-2" />
+    <kerning first="111" second="84" amount="-2" />
+    <kerning first="111" second="89" amount="-2" />
+    <kerning first="111" second="106" amount="-2" />
+    <kerning first="111" second="221" amount="-2" />
+    <kerning first="112" second="84" amount="-3" />
+    <kerning first="112" second="89" amount="-2" />
+    <kerning first="112" second="106" amount="-1" />
+    <kerning first="112" second="221" amount="-2" />
+    <kerning first="113" second="84" amount="-2" />
+    <kerning first="113" second="86" amount="-1" />
+    <kerning first="113" second="89" amount="-2" />
+    <kerning first="113" second="221" amount="-2" />
+    <kerning first="114" second="74" amount="-2" />
+    <kerning first="114" second="84" amount="-2" />
+    <kerning first="114" second="90" amount="-2" />
+    <kerning first="114" second="106" amount="-1" />
+    <kerning first="114" second="198" amount="-2" />
+    <kerning first="115" second="84" amount="-2" />
+    <kerning first="115" second="89" amount="-2" />
+    <kerning first="115" second="106" amount="-2" />
+    <kerning first="115" second="221" amount="-2" />
+    <kerning first="116" second="106" amount="-1" />
+    <kerning first="117" second="84" amount="-2" />
+    <kerning first="117" second="106" amount="-1" />
+    <kerning first="118" second="65" amount="-1" />
+    <kerning first="118" second="84" amount="-2" />
+    <kerning first="118" second="90" amount="-2" />
+    <kerning first="118" second="106" amount="-2" />
+    <kerning first="118" second="192" amount="-1" />
+    <kerning first="118" second="193" amount="-1" />
+    <kerning first="118" second="194" amount="-1" />
+    <kerning first="118" second="195" amount="-1" />
+    <kerning first="118" second="196" amount="-1" />
+    <kerning first="118" second="197" amount="-1" />
+    <kerning first="118" second="198" amount="-2" />
+    <kerning first="119" second="84" amount="-3" />
+    <kerning first="119" second="89" amount="-1" />
+    <kerning first="119" second="106" amount="-2" />
+    <kerning first="119" second="221" amount="-1" />
+    <kerning first="120" second="84" amount="-2" />
+    <kerning first="120" second="106" amount="-1" />
+    <kerning first="121" second="65" amount="-1" />
+    <kerning first="121" second="84" amount="-3" />
+    <kerning first="121" second="88" amount="-1" />
+    <kerning first="121" second="89" amount="-1" />
+    <kerning first="121" second="90" amount="-1" />
+    <kerning first="121" second="106" amount="-1" />
+    <kerning first="121" second="192" amount="-1" />
+    <kerning first="121" second="193" amount="-1" />
+    <kerning first="121" second="194" amount="-1" />
+    <kerning first="121" second="195" amount="-1" />
+    <kerning first="121" second="196" amount="-1" />
+    <kerning first="121" second="197" amount="-1" />
+    <kerning first="121" second="198" amount="-1" />
+    <kerning first="255" second="84" amount="-1" />
+    <kerning first="122" second="84" amount="-3" />
+    <kerning first="255" second="65" amount="-1" />
+    <kerning first="122" second="106" amount="-1" />
+    <kerning first="122" second="221" amount="-1" />
+    <kerning first="192" second="84" amount="-2" />
+    <kerning first="192" second="86" amount="-2" />
+    <kerning first="192" second="87" amount="-1" />
+    <kerning first="192" second="89" amount="-2" />
+    <kerning first="192" second="106" amount="-2" />
+    <kerning first="192" second="118" amount="-1" />
+    <kerning first="192" second="221" amount="-2" />
+    <kerning first="192" second="253" amount="-1" />
+    <kerning first="254" second="221" amount="-2" />
+    <kerning first="193" second="84" amount="-2" />
+    <kerning first="193" second="86" amount="-2" />
+    <kerning first="193" second="87" amount="-1" />
+    <kerning first="193" second="89" amount="-2" />
+    <kerning first="193" second="106" amount="-2" />
+    <kerning first="193" second="221" amount="-2" />
+    <kerning first="254" second="106" amount="-2" />
+    <kerning first="254" second="89" amount="-2" />
+    <kerning first="194" second="84" amount="-2" />
+    <kerning first="194" second="86" amount="-2" />
+    <kerning first="194" second="87" amount="-1" />
+    <kerning first="194" second="89" amount="-2" />
+    <kerning first="194" second="106" amount="-1" />
+    <kerning first="194" second="221" amount="-2" />
+    <kerning first="254" second="84" amount="-2" />
+    <kerning first="253" second="198" amount="-1" />
+    <kerning first="195" second="84" amount="-2" />
+    <kerning first="195" second="86" amount="-2" />
+    <kerning first="195" second="87" amount="-1" />
+    <kerning first="195" second="89" amount="-2" />
+    <kerning first="195" second="106" amount="-1" />
+    <kerning first="195" second="221" amount="-2" />
+    <kerning first="253" second="197" amount="-1" />
+    <kerning first="253" second="196" amount="-1" />
+    <kerning first="196" second="84" amount="-2" />
+    <kerning first="196" second="86" amount="-2" />
+    <kerning first="196" second="87" amount="-2" />
+    <kerning first="196" second="89" amount="-2" />
+    <kerning first="196" second="106" amount="-1" />
+    <kerning first="196" second="118" amount="-1" />
+    <kerning first="196" second="221" amount="-2" />
+    <kerning first="253" second="195" amount="-1" />
+    <kerning first="253" second="194" amount="-1" />
+    <kerning first="197" second="84" amount="-2" />
+    <kerning first="197" second="86" amount="-2" />
+    <kerning first="197" second="87" amount="-2" />
+    <kerning first="197" second="89" amount="-2" />
+    <kerning first="197" second="106" amount="-2" />
+    <kerning first="197" second="118" amount="-1" />
+    <kerning first="197" second="221" amount="-2" />
+    <kerning first="197" second="253" amount="-1" />
+    <kerning first="197" second="255" amount="-1" />
+    <kerning first="198" second="106" amount="-2" />
+    <kerning first="199" second="67" amount="-1" />
+    <kerning first="199" second="71" amount="-1" />
+    <kerning first="199" second="79" amount="-1" />
+    <kerning first="199" second="81" amount="-1" />
+    <kerning first="199" second="102" amount="-1" />
+    <kerning first="199" second="106" amount="-2" />
+    <kerning first="199" second="116" amount="-1" />
+    <kerning first="199" second="118" amount="-2" />
+    <kerning first="199" second="119" amount="-1" />
+    <kerning first="199" second="121" amount="-2" />
+    <kerning first="199" second="199" amount="-1" />
+    <kerning first="253" second="193" amount="-1" />
+    <kerning first="199" second="205" amount="-1" />
+    <kerning first="199" second="206" amount="-1" />
+    <kerning first="253" second="192" amount="-1" />
+    <kerning first="253" second="106" amount="-2" />
+    <kerning first="199" second="210" amount="-1" />
+    <kerning first="199" second="211" amount="-1" />
+    <kerning first="199" second="212" amount="-1" />
+    <kerning first="199" second="213" amount="-1" />
+    <kerning first="199" second="214" amount="-1" />
+    <kerning first="253" second="65" amount="-1" />
+    <kerning first="199" second="253" amount="-2" />
+    <kerning first="199" second="255" amount="-1" />
+    <kerning first="200" second="106" amount="-2" />
+    <kerning first="252" second="221" amount="-1" />
+    <kerning first="252" second="106" amount="-2" />
+    <kerning first="200" second="253" amount="-1" />
+    <kerning first="201" second="106" amount="-2" />
+    <kerning first="252" second="89" amount="-1" />
+    <kerning first="252" second="84" amount="-2" />
+    <kerning first="202" second="106" amount="-1" />
+    <kerning first="251" second="106" amount="-2" />
+    <kerning first="251" second="84" amount="-1" />
+    <kerning first="203" second="106" amount="-1" />
+    <kerning first="203" second="121" amount="-1" />
+    <kerning first="250" second="106" amount="-2" />
+    <kerning first="204" second="106" amount="-2" />
+    <kerning first="205" second="106" amount="-2" />
+    <kerning first="206" second="106" amount="-2" />
+    <kerning first="207" second="106" amount="-2" />
+    <kerning first="208" second="106" amount="-1" />
+    <kerning first="209" second="106" amount="-2" />
+    <kerning first="210" second="84" amount="-1" />
+    <kerning first="210" second="106" amount="-1" />
+    <kerning first="211" second="84" amount="-1" />
+    <kerning first="211" second="106" amount="-1" />
+    <kerning first="212" second="84" amount="-1" />
+    <kerning first="212" second="106" amount="-2" />
+    <kerning first="213" second="84" amount="-1" />
+    <kerning first="213" second="106" amount="-1" />
+    <kerning first="214" second="84" amount="-1" />
+    <kerning first="214" second="89" amount="-1" />
+    <kerning first="214" second="106" amount="-2" />
+    <kerning first="214" second="221" amount="-1" />
+    <kerning first="216" second="106" amount="-1" />
+    <kerning first="217" second="106" amount="-1" />
+    <kerning first="218" second="106" amount="-1" />
+    <kerning first="219" second="106" amount="-1" />
+    <kerning first="220" second="106" amount="-2" />
+    <kerning first="221" second="65" amount="-2" />
+    <kerning first="221" second="74" amount="-2" />
+    <kerning first="221" second="97" amount="-1" />
+    <kerning first="221" second="99" amount="-1" />
+    <kerning first="221" second="100" amount="-2" />
+    <kerning first="221" second="101" amount="-2" />
+    <kerning first="221" second="103" amount="-2" />
+    <kerning first="221" second="106" amount="-2" />
+    <kerning first="221" second="111" amount="-1" />
+    <kerning first="221" second="112" amount="-2" />
+    <kerning first="221" second="113" amount="-1" />
+    <kerning first="221" second="115" amount="-1" />
+    <kerning first="221" second="192" amount="-2" />
+    <kerning first="221" second="193" amount="-2" />
+    <kerning first="221" second="194" amount="-2" />
+    <kerning first="221" second="195" amount="-2" />
+    <kerning first="221" second="196" amount="-2" />
+    <kerning first="221" second="197" amount="-2" />
+    <kerning first="221" second="198" amount="-2" />
+    <kerning first="221" second="224" amount="-1" />
+    <kerning first="221" second="225" amount="-2" />
+    <kerning first="221" second="226" amount="-1" />
+    <kerning first="221" second="228" amount="-1" />
+    <kerning first="221" second="229" amount="-1" />
+    <kerning first="221" second="230" amount="-2" />
+    <kerning first="221" second="231" amount="-2" />
+    <kerning first="221" second="232" amount="-1" />
+    <kerning first="221" second="233" amount="-2" />
+    <kerning first="221" second="234" amount="-1" />
+    <kerning first="221" second="235" amount="-1" />
+    <kerning first="221" second="240" amount="-1" />
+    <kerning first="221" second="242" amount="-1" />
+    <kerning first="221" second="243" amount="-1" />
+    <kerning first="221" second="244" amount="-1" />
+    <kerning first="221" second="246" amount="-1" />
+    <kerning first="221" second="248" amount="-1" />
+    <kerning first="222" second="84" amount="-2" />
+    <kerning first="222" second="88" amount="-1" />
+    <kerning first="222" second="89" amount="-2" />
+    <kerning first="222" second="90" amount="-2" />
+    <kerning first="222" second="106" amount="-3" />
+    <kerning first="222" second="198" amount="-1" />
+    <kerning first="222" second="221" amount="-2" />
+    <kerning first="223" second="84" amount="-1" />
+    <kerning first="223" second="89" amount="-1" />
+    <kerning first="223" second="106" amount="-2" />
+    <kerning first="223" second="221" amount="-1" />
+    <kerning first="224" second="84" amount="-1" />
+    <kerning first="224" second="89" amount="-2" />
+    <kerning first="224" second="106" amount="-1" />
+    <kerning first="224" second="221" amount="-2" />
+    <kerning first="225" second="84" amount="-1" />
+    <kerning first="225" second="89" amount="-1" />
+    <kerning first="225" second="106" amount="-1" />
+    <kerning first="225" second="221" amount="-1" />
+    <kerning first="226" second="84" amount="-2" />
+    <kerning first="226" second="86" amount="-1" />
+    <kerning first="226" second="89" amount="-2" />
+    <kerning first="226" second="106" amount="-2" />
+    <kerning first="226" second="221" amount="-1" />
+    <kerning first="227" second="106" amount="-1" />
+    <kerning first="228" second="84" amount="-3" />
+    <kerning first="228" second="86" amount="-1" />
+    <kerning first="228" second="89" amount="-1" />
+    <kerning first="228" second="106" amount="-2" />
+    <kerning first="228" second="221" amount="-1" />
+    <kerning first="229" second="84" amount="-1" />
+    <kerning first="229" second="86" amount="-1" />
+    <kerning first="229" second="89" amount="-1" />
+    <kerning first="229" second="106" amount="-2" />
+    <kerning first="229" second="221" amount="-1" />
+    <kerning first="230" second="84" amount="-2" />
+    <kerning first="230" second="89" amount="-2" />
+    <kerning first="230" second="106" amount="-2" />
+    <kerning first="230" second="221" amount="-2" />
+    <kerning first="231" second="84" amount="-2" />
+    <kerning first="231" second="89" amount="-2" />
+    <kerning first="231" second="221" amount="-1" />
+    <kerning first="232" second="84" amount="-2" />
+    <kerning first="250" second="84" amount="-1" />
+    <kerning first="232" second="89" amount="-1" />
+    <kerning first="232" second="106" amount="-2" />
+    <kerning first="232" second="221" amount="-2" />
+    <kerning first="233" second="84" amount="-1" />
+    <kerning first="233" second="89" amount="-1" />
+    <kerning first="233" second="106" amount="-2" />
+    <kerning first="233" second="221" amount="-1" />
+    <kerning first="234" second="84" amount="-2" />
+    <kerning first="234" second="86" amount="-1" />
+    <kerning first="234" second="89" amount="-1" />
+    <kerning first="234" second="106" amount="-2" />
+    <kerning first="234" second="221" amount="-1" />
+    <kerning first="235" second="84" amount="-2" />
+    <kerning first="235" second="89" amount="-1" />
+    <kerning first="235" second="106" amount="-2" />
+    <kerning first="235" second="221" amount="-1" />
+    <kerning first="236" second="106" amount="-2" />
+    <kerning first="237" second="106" amount="-2" />
+    <kerning first="238" second="106" amount="-1" />
+    <kerning first="249" second="221" amount="-1" />
+    <kerning first="239" second="106" amount="-2" />
+    <kerning first="240" second="106" amount="-2" />
+    <kerning first="241" second="106" amount="-2" />
+    <kerning first="242" second="84" amount="-1" />
+    <kerning first="242" second="89" amount="-1" />
+    <kerning first="242" second="106" amount="-2" />
+    <kerning first="242" second="221" amount="-1" />
+    <kerning first="243" second="84" amount="-1" />
+    <kerning first="243" second="89" amount="-1" />
+    <kerning first="243" second="106" amount="-2" />
+    <kerning first="243" second="221" amount="-1" />
+    <kerning first="244" second="84" amount="-1" />
+    <kerning first="244" second="89" amount="-1" />
+    <kerning first="244" second="106" amount="-2" />
+    <kerning first="244" second="221" amount="-1" />
+    <kerning first="245" second="84" amount="-1" />
+    <kerning first="245" second="106" amount="-2" />
+    <kerning first="246" second="84" amount="-2" />
+    <kerning first="246" second="89" amount="-1" />
+    <kerning first="246" second="106" amount="-2" />
+    <kerning first="246" second="221" amount="-1" />
+    <kerning first="248" second="84" amount="-1" />
+    <kerning first="248" second="106" amount="-2" />
+    <kerning first="249" second="84" amount="-2" />
+    <kerning first="249" second="89" amount="-1" />
+    <kerning first="249" second="106" amount="-2" />
+  </kernings>
+</font>

BIN
Samples/basic/bitmapfont/data/Comfortaa_Regular_22.tga


+ 49 - 0
Samples/basic/bitmapfont/data/LICENSE.txt

@@ -0,0 +1,49 @@
+The files "Comfortaa_Regular_22.fnt" and "Comfortaa_Regular_22.tga" represent a bitmap render of a subset of the font "Comfortaa Regular". The license of the font is attached below.
+
+
+-----------------------------------------------------------
+
+Copyright (c) 2010, Johan Aakerlund ([email protected]),
+with Reserved Font Name "Comfortaa".
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
+
+"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
+
+5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.

+ 31 - 0
Samples/basic/bitmapfont/data/bitmapfont.rml

@@ -0,0 +1,31 @@
+<rml>
+<head>
+<title>Demo</title>
+<link type="text/template" href="../../../Assets/window.rml" />
+<style>
+body
+{
+	width: 600px;
+	height: 500px;
+	font-family: Comfortaa;
+	margin: auto;
+	font-size: 22px;
+}
+
+div#title_bar div#icon
+{
+	display: none;
+}
+
+div#content
+{
+	text-align: left;
+}
+</style>
+</head>
+<body template="window">
+	<p>This is a bitmap font sample!</p>
+	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Urna neque viverra justo nec ultrices dui sapien eget mi. Risus quis varius quam quisque id. Amet est placerat in egestas erat imperdiet. Velit egestas dui id ornare arcu odio ut sem. Aliquet porttitor lacus luctus accumsan tortor posuere. Et malesuada fames ac turpis egestas integer eget. Enim nunc faucibus a pellentesque sit amet porttitor eget. Nunc pulvinar sapien et ligula. Sit amet mattis vulputate enim nulla aliquet porttitor lacus luctus. Dolor sit amet consectetur adipiscing. Congue eu consequat ac felis donec et odio pellentesque. Nunc non blandit massa enim nec dui nunc mattis.</p>
+	<p>Posuere sollicitudin aliquam ultrices sagittis orci a scelerisque. Quam pellentesque nec nam aliquam sem et. Et tortor consequat id porta nibh venenatis. Facilisi cras fermentum odio eu feugiat pretium nibh ipsum consequat. Magna ac placerat vestibulum lectus mauris ultrices eros. Amet purus gravida quis blandit turpis cursus. Elit duis tristique sollicitudin nibh sit amet commodo nulla. Suscipit adipiscing bibendum est ultricies integer quis auctor elit sed. Iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Pellentesque elit ullamcorper dignissim cras. Nunc eget lorem dolor sed viverra ipsum nunc. Ac felis donec et odio pellentesque diam volutpat commodo.</p>
+</body>
+</rml>

+ 313 - 0
Samples/basic/bitmapfont/src/FontEngineBitmap.cpp

@@ -0,0 +1,313 @@
+/*
+ * This source file is part of RmlUi, the HTML/CSS Interface Middleware
+ *
+ * For the latest information, see http://github.com/mikke89/RmlUi
+ *
+ * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
+ * Copyright (c) 2019 The RmlUi Team, and contributors
+ *
+ * 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.
+ *
+ */
+
+#include <cstdio>
+#include <RmlUi/Core.h>
+#include <RmlUi/Core/StreamMemory.h>
+#include "FontEngineBitmap.h"
+
+namespace FontProviderBitmap
+{
+	static std::vector<std::unique_ptr<FontFaceBitmap>> fonts;
+
+
+	void Initialise()
+	{
+	}
+
+	void Shutdown()
+	{
+		fonts.clear();
+	}
+
+	bool LoadFontFace(const String& file_name, bool fallback_face)
+	{
+		// Load the xml meta file into memory
+		std::unique_ptr<byte[]> data;
+		size_t length = 0;
+
+		{
+			auto file_interface = Rml::Core::GetFileInterface();
+			auto handle = file_interface->Open(file_name);
+			if (!handle)
+				return false;
+
+			length = file_interface->Length(handle);
+			
+			data.reset(new byte[length]);
+
+			size_t read_length = file_interface->Read(data.get(), length, handle);
+
+			file_interface->Close(handle);
+
+			if (read_length != length || !data)
+				return false;
+		}
+
+		// Parse the xml font description
+		FontParserBitmap parser;
+
+		{
+			auto stream = std::make_unique<Rml::Core::StreamMemory>(data.get(), length);
+			stream->SetSourceURL(file_name);
+
+			parser.Parse(stream.get());
+
+			if (parser.family.empty() || parser.glyphs.empty() || parser.texture_name.empty() || parser.metrics.size == 0)
+				return false;
+
+			// Fill the remaining metrics
+			parser.metrics.underline_position = -parser.metrics.baseline - 1.f;
+			parser.metrics.underline_thickness = 1.f;
+		}
+
+		Texture texture;
+		texture.Set(parser.texture_name, file_name);
+
+		// Construct and add the font face
+		fonts.push_back(
+			std::make_unique<FontFaceBitmap>( 
+				parser.family, parser.style, parser.weight, parser.metrics, texture, parser.texture_dimensions, std::move(parser.glyphs), std::move(parser.kerning)
+		));
+
+		return true;
+	}
+
+	FontFaceBitmap* GetFontFaceHandle(const String& family, FontStyle style, FontWeight weight, int size)
+	{
+		FontFaceBitmap* best_match = nullptr;
+		int best_score = 0;
+
+		// Normally, we'd want to only match the font family exactly, but for this demo we create a very lenient heuristic.
+		for (const auto& font : fonts)
+		{
+			int score = 1;
+			if (font->GetFamily() == family)
+				score += 100;
+
+			score += 10 - std::min(10, std::abs(font->GetMetrics().size - size));
+
+			if (font->GetStyle() == style)
+				score += 2;
+			if (font->GetWeight() == weight)
+				score += 1;
+
+			if (score > best_score)
+			{
+				best_match = font.get();
+				best_score = score;
+			}
+		}
+		
+		return best_match;
+	}
+
+}
+
+
+FontFaceBitmap::FontFaceBitmap(String family, FontStyle style, FontWeight weight, FontMetrics metrics, Texture texture, Vector2f texture_dimensions, FontGlyphs&& glyphs, FontKerning&& kerning)
+	: family(family), style(style), weight(weight), metrics(metrics), texture(texture), texture_dimensions(texture_dimensions), glyphs(std::move(glyphs)), kerning(std::move(kerning)) 
+{}
+
+int FontFaceBitmap::GetStringWidth(const String& string, Character previous_character)
+{
+	int width = 0;
+
+	for (auto it_char = Rml::Core::StringIteratorU8(string); it_char; ++it_char)
+	{
+		Character character = *it_char;
+
+		auto it_glyph = glyphs.find(character);
+		if (it_glyph == glyphs.end())
+			continue;
+
+		const BitmapGlyph& glyph = it_glyph->second;
+
+		int kerning = GetKerning(previous_character, character);
+
+		width += glyph.advance + kerning;
+	}
+
+	return width;
+}
+
+int FontFaceBitmap::GenerateString(const String& string, const Vector2f& string_position, const Colourb& colour, GeometryList& geometry_list)
+{
+	int width = 0;
+
+	geometry_list.resize(1);
+	Rml::Core::Geometry& geometry = geometry_list[0];
+
+	geometry.SetTexture(&texture);
+
+	auto& vertices = geometry.GetVertices();
+	auto& indices = geometry.GetIndices();
+
+	vertices.reserve(string.size() * 4);
+	indices.reserve(string.size() * 6);
+
+	Vector2f position = string_position.Round();
+	Character previous_character = Character::Null;
+
+	for (auto it_char = Rml::Core::StringIteratorU8(string); it_char; ++it_char)
+	{
+		Character character = *it_char;
+
+		auto it_glyph = glyphs.find(character);
+		if (it_glyph == glyphs.end())
+			continue;
+
+		int kerning = GetKerning(previous_character, character);
+
+		width += kerning;
+		position.x += kerning;
+
+		const BitmapGlyph& glyph = it_glyph->second;
+
+		// Generate the geometry for the character.
+		vertices.resize(vertices.size() + 4);
+		indices.resize(indices.size() + 6);
+
+		Vector2f uv_top_left = glyph.position / texture_dimensions;
+		Vector2f uv_bottom_right = (glyph.position + glyph.dimension) / texture_dimensions;
+
+		Rml::Core::GeometryUtilities::GenerateQuad(
+			&vertices[0] + (vertices.size() - 4),
+			&indices[0] + (indices.size() - 6),
+			Vector2f(position + glyph.offset).Round(),
+			glyph.dimension,
+			colour,
+			uv_top_left,
+			uv_bottom_right,
+			(int)vertices.size() - 4
+		);
+
+		width += glyph.advance;
+		position.x += glyph.advance;
+
+		previous_character = character;
+	}
+
+	return width;
+}
+
+int FontFaceBitmap::GetKerning(Character left, Character right) const
+{
+	std::uint64_t key = (((std::uint64_t)left << 32) | (std::uint64_t)right);
+
+	auto it = kerning.find(key);
+	if (it != kerning.end())
+		return it->second;
+
+	return 0;
+}
+
+
+
+
+
+FontParserBitmap::~FontParserBitmap()
+{
+}
+
+// Called when the parser finds the beginning of an element tag.
+void FontParserBitmap::HandleElementStart(const String& name, const Rml::Core::XMLAttributes& attributes)
+{
+	if (name == "info")
+	{
+		family = Rml::Core::StringUtilities::ToLower( Get(attributes, "face", String()) );
+		metrics.size = Get(attributes, "size", 0);
+		metrics.line_height = Get(attributes, "height", 0);
+
+		style = Get(attributes, "italic", 0) == 1 ? FontStyle::Italic : FontStyle::Normal;
+		weight = Get(attributes, "bold", 0) == 1 ? FontWeight::Bold : FontWeight::Normal;
+	}
+	else if (name == "common")
+	{
+		metrics.line_height = Get(attributes, "lineHeight", 0);
+		metrics.baseline = Get(attributes, "base", 0);
+
+		texture_dimensions.x = Get(attributes, "scaleW", 0.f);
+		texture_dimensions.y = Get(attributes, "scaleH", 0.f);
+	}
+	else if (name == "page")
+	{
+		int id = Get(attributes, "id", -1);
+		if(id != 0)
+		{
+			Rml::Core::Log::Message(Rml::Core::Log::LT_WARNING, "Only single font textures are supported in Bitmap Font Engine");
+			return;
+		}
+		texture_name = Get(attributes, "file", String());
+	}
+	else if (name == "char")
+	{
+		Character character = (Character)Get(attributes, "id", 0);
+		if (character == Character::Null)
+			return;
+
+		BitmapGlyph& glyph = glyphs[character];
+
+		glyph.advance = Get(attributes, "xadvance", 0);
+
+		glyph.offset.x = Get(attributes, "xoffset", 0.f);
+		glyph.offset.y = Get(attributes, "yoffset", 0.f);
+		
+		glyph.position.x = Get(attributes, "x", 0.f);
+		glyph.position.y = Get(attributes, "y", 0.f);
+		glyph.dimension.x = Get(attributes, "width", 0.f);
+		glyph.dimension.y = Get(attributes, "height", 0.f);
+
+		if (character == (Character)'x')
+			metrics.x_height = (int)glyph.dimension.y;
+	}
+	else if (name == "kerning")
+	{
+		std::uint64_t first = (std::uint64_t)Get(attributes, "first", 0);
+		std::uint64_t second = (std::uint64_t)Get(attributes, "second", 0);
+		int amount = Get(attributes, "amount", 0);
+
+		if (first != 0 && second != 0 && amount != 0)
+		{
+			std::uint64_t key = ((first << 32) | second);
+			kerning[key] = amount;
+		}
+	}
+}
+
+// Called when the parser finds the end of an element tag.
+void FontParserBitmap::HandleElementEnd(const String& RMLUI_UNUSED_PARAMETER(name))
+{
+	RMLUI_UNUSED(name);
+}
+
+// Called when the parser encounters data.
+void FontParserBitmap::HandleData(const String& RMLUI_UNUSED_PARAMETER(data))
+{
+	RMLUI_UNUSED(data);
+}

+ 133 - 0
Samples/basic/bitmapfont/src/FontEngineBitmap.h

@@ -0,0 +1,133 @@
+/*
+ * This source file is part of RmlUi, the HTML/CSS Interface Middleware
+ *
+ * For the latest information, see http://github.com/mikke89/RmlUi
+ *
+ * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
+ * Copyright (c) 2019 The RmlUi Team, and contributors
+ *
+ * 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.
+ *
+ */
+
+#ifndef FONTENGINEBITMAP_H
+#define FONTENGINEBITMAP_H
+
+#include <cstdint>
+#include <RmlUi/Core/Types.h>
+#include "FontEngineInterfaceBitmap.h"
+
+class FontFaceBitmap;
+
+namespace FontProviderBitmap
+{
+	void Initialise();
+	void Shutdown();
+	bool LoadFontFace(const String& file_name, bool fallback_face);
+	FontFaceBitmap* GetFontFaceHandle(const String& family, FontStyle style, FontWeight weight, int size);
+};
+
+
+struct BitmapGlyph {
+	int advance = 0;
+	Vector2f offset = { 0, 0 };
+	Vector2f position = { 0, 0 };
+	Vector2f dimension = { 0, 0 };
+};
+
+struct FontMetrics {
+	int size = 0;
+	int x_height = 0;
+	int line_height = 0;
+	int baseline = 0;
+	float underline_position = 0, underline_thickness = 0;
+};
+
+// A mapping of characters to their glyphs.
+using FontGlyphs = std::unordered_map<Character, BitmapGlyph>;
+
+// Mapping of combined (left, right) character to kerning in pixels.
+using FontKerning = std::unordered_map<std::uint64_t, int>;
+
+
+class FontFaceBitmap {
+public:
+	FontFaceBitmap(String family, FontStyle style, FontWeight weight, FontMetrics metrics, Texture texture, Vector2f texture_dimensions, FontGlyphs&& glyphs, FontKerning&& kerning);
+
+	// Get width of string.
+	int GetStringWidth(const String& string, Character prior_character);
+
+	// Generate the string geometry, returning its width.
+	int GenerateString(const String& string, const Vector2f& position, const Colourb& colour, GeometryList& geometry);
+
+
+	const FontMetrics& GetMetrics() const { return metrics; }
+	
+	const String& GetFamily() const { return family; }
+	FontStyle GetStyle() const { return style; }
+	FontWeight GetWeight() const { return weight; }
+
+private:
+	int GetKerning(Character left, Character right) const;
+
+	String family;
+	FontStyle style;
+	FontWeight weight;
+
+	FontMetrics metrics;
+
+	Texture texture;
+	Vector2f texture_dimensions;
+
+	FontGlyphs glyphs;
+	FontKerning kerning;
+};
+
+
+/*
+	Parses the font meta data from an xml file.
+*/
+
+class FontParserBitmap : public Rml::Core::BaseXMLParser
+{
+public:
+	FontParserBitmap() {}
+	virtual ~FontParserBitmap();
+
+	/// Called when the parser finds the beginning of an element tag.
+	void HandleElementStart(const String& name, const Rml::Core::XMLAttributes& attributes) override;
+	/// Called when the parser finds the end of an element tag.
+	void HandleElementEnd(const String& name) override;
+	/// Called when the parser encounters data.
+	void HandleData(const String& data) override;
+
+	String family;
+	FontStyle style = FontStyle::Normal;
+	FontWeight weight = FontWeight::Normal;
+
+	String texture_name;
+	Vector2f texture_dimensions = { 0, 0 };
+
+	FontMetrics metrics;
+	FontGlyphs glyphs;
+	FontKerning kerning;
+};
+
+
+#endif

+ 117 - 0
Samples/basic/bitmapfont/src/FontEngineInterfaceBitmap.cpp

@@ -0,0 +1,117 @@
+/*
+ * This source file is part of RmlUi, the HTML/CSS Interface Middleware
+ *
+ * For the latest information, see http://github.com/mikke89/RmlUi
+ *
+ * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
+ * Copyright (c) 2019 The RmlUi Team, and contributors
+ *
+ * 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.
+ *
+ */
+
+#include <RmlUi/Core.h>
+#include "FontEngineInterfaceBitmap.h"
+#include "FontEngineBitmap.h"
+
+FontEngineInterfaceBitmap::FontEngineInterfaceBitmap()
+{
+	FontProviderBitmap::Initialise();
+}
+
+FontEngineInterfaceBitmap::~FontEngineInterfaceBitmap()
+{
+	FontProviderBitmap::Shutdown();
+}
+
+bool FontEngineInterfaceBitmap::LoadFontFace(const String& file_name, bool fallback_face)
+{
+	return FontProviderBitmap::LoadFontFace(file_name, fallback_face);
+}
+
+bool FontEngineInterfaceBitmap::LoadFontFace(const byte* data, int data_size, const String& font_family, FontStyle style, FontWeight weight, bool fallback_face)
+{
+	// We return 'true' here to allow the debugger to continue loading, but we will use our own fonts when it asks for a handle.
+	// The debugger might look a bit off with our own fonts, but hey it works.
+	if (font_family == "rmlui-debugger-font")
+		return true;
+
+	return false;
+}
+
+FontFaceHandle FontEngineInterfaceBitmap::GetFontFaceHandle(const String& family, FontStyle style, FontWeight weight, int size)
+{
+	auto handle = FontProviderBitmap::GetFontFaceHandle(family, style, weight, size);
+	return reinterpret_cast<FontFaceHandle>(handle);
+}
+
+FontEffectsHandle FontEngineInterfaceBitmap::PrepareFontEffects(FontFaceHandle handle, const FontEffectList& font_effects)
+{
+	// Font effects are not rendered in this implementation.
+	return 0;
+}
+
+int FontEngineInterfaceBitmap::GetSize(FontFaceHandle handle)
+{
+	auto handle_bitmap = reinterpret_cast<FontFaceBitmap*>(handle);
+	return handle_bitmap->GetMetrics().size;
+}
+
+int FontEngineInterfaceBitmap::GetXHeight(FontFaceHandle handle)
+{
+	auto handle_bitmap = reinterpret_cast<FontFaceBitmap*>(handle);
+	return handle_bitmap->GetMetrics().x_height;
+}
+
+int FontEngineInterfaceBitmap::GetLineHeight(FontFaceHandle handle)
+{
+	auto handle_bitmap = reinterpret_cast<FontFaceBitmap*>(handle);
+	return handle_bitmap->GetMetrics().line_height;
+}
+
+int FontEngineInterfaceBitmap::GetBaseline(FontFaceHandle handle)
+{
+	auto handle_bitmap = reinterpret_cast<FontFaceBitmap*>(handle);
+	return handle_bitmap->GetMetrics().baseline;
+}
+
+float FontEngineInterfaceBitmap::GetUnderline(FontFaceHandle handle, float& thickness)
+{
+	auto handle_bitmap = reinterpret_cast<FontFaceBitmap*>(handle);
+	thickness = handle_bitmap->GetMetrics().underline_thickness;
+	return handle_bitmap->GetMetrics().underline_position;
+}
+
+int FontEngineInterfaceBitmap::GetStringWidth(FontFaceHandle handle, const String& string, Character prior_character)
+{
+	auto handle_bitmap = reinterpret_cast<FontFaceBitmap*>(handle);
+	return handle_bitmap->GetStringWidth(string, prior_character);
+}
+
+int FontEngineInterfaceBitmap::GenerateString(FontFaceHandle handle, FontEffectsHandle font_effects_handle, const String& string,
+	const Vector2f& position, const Colourb& colour, GeometryList& geometry)
+{
+	auto handle_bitmap = reinterpret_cast<FontFaceBitmap*>(handle);
+	return handle_bitmap->GenerateString(string, position, colour, geometry);
+}
+
+int FontEngineInterfaceBitmap::GetVersion(FontFaceHandle handle)
+{
+	return 0;
+}

+ 99 - 0
Samples/basic/bitmapfont/src/FontEngineInterfaceBitmap.h

@@ -0,0 +1,99 @@
+/*
+ * This source file is part of RmlUi, the HTML/CSS Interface Middleware
+ *
+ * For the latest information, see http://github.com/mikke89/RmlUi
+ *
+ * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
+ * Copyright (c) 2019 The RmlUi Team, and contributors
+ *
+ * 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.
+ *
+ */
+
+#ifndef FONTENGINEINTERFACEBITMAP_H
+#define FONTENGINEINTERFACEBITMAP_H
+
+#include <RmlUi/Core/Types.h>
+#include <RmlUi/Core/Context.h>
+#include <RmlUi/Core/FontEngineInterface.h>
+#include <RmlUi/Core/SpriteSheet.h>
+
+using Rml::Core::FontFaceHandle;
+using Rml::Core::FontEffectsHandle;
+
+using Rml::Core::Vector2i;
+using Rml::Core::Vector2f;
+using Rml::Core::Colourb;
+using Rml::Core::Texture;
+using Rml::Core::String;
+using Rml::Core::Character;
+using Rml::Core::Style::FontStyle;
+using Rml::Core::Style::FontWeight;
+using Rml::Core::byte;
+
+using Rml::Core::FontEffectList;
+using Rml::Core::GeometryList;
+
+
+class RMLUICORE_API FontEngineInterfaceBitmap : public Rml::Core::FontEngineInterface
+{
+public:
+	FontEngineInterfaceBitmap();
+	virtual ~FontEngineInterfaceBitmap();
+
+	/// Called by RmlUi when it wants to load a font face from file.
+	bool LoadFontFace(const String& file_name, bool fallback_face) override;
+
+	/// Called by RmlUi when it wants to load a font face from memory, registered using the provided family, style, and weight.
+	/// @param[in] data A pointer to the data.
+	bool LoadFontFace(const byte* data, int data_size, const String& family, FontStyle style, FontWeight weight, bool fallback_face) override;
+
+	/// Called by RmlUi when a font configuration is resolved for an element. Should return a handle that 
+	/// can later be used to resolve properties of the face, and generate string geometry to be rendered.
+	FontFaceHandle GetFontFaceHandle(const String& family, FontStyle style, FontWeight weight, int size) override;
+
+	/// Called by RmlUi when a list of font effects is resolved for an element with a given font face.
+	FontEffectsHandle PrepareFontEffects(FontFaceHandle handle, const FontEffectList& font_effects) override;
+
+	/// Should return the point size of this font face.
+	int GetSize(FontFaceHandle handle) override;
+	/// Should return the pixel height of a lower-case x in this font face.
+	int GetXHeight(FontFaceHandle handle) override;
+	/// Should return the default height between this font face's baselines.
+	int GetLineHeight(FontFaceHandle handle) override;
+
+	/// Should return the font's baseline, as a pixel offset from the bottom of the font.
+	int GetBaseline(FontFaceHandle handle) override;
+
+	/// Should return the font's underline, as a pixel offset from the bottom of the font.
+	float GetUnderline(FontFaceHandle handle, float& thickness) override;
+
+	/// Called by RmlUi when it wants to retrieve the width of a string when rendered with this handle.
+	int GetStringWidth(FontFaceHandle handle, const String& string, Character prior_character = Character::Null) override;
+
+	/// Called by RmlUi when it wants to retrieve the geometry required to render a single line of text.
+	int GenerateString(FontFaceHandle face_handle, FontEffectsHandle font_effects_handle, const String& string, const Vector2f& position, const Colourb& colour, GeometryList& geometry) override;
+
+	/// Called by RmlUi to determine if the text geometry is required to be re-generated.eometry.
+	int GetVersion(FontFaceHandle handle) override;
+};
+
+
+
+#endif

+ 29 - 4
Samples/basic/bitmapfont/src/main.cpp

@@ -32,6 +32,17 @@
 #include <Shell.h>
 #include <ShellRenderInterfaceOpenGL.h>
 
+#include "FontEngineInterfaceBitmap.h"
+
+/*
+
+	This demo shows how to create a custom bitmap font engine implementation. 
+	
+	It should work even when RmlUi is compiled without the default font engine (see CMake flag 'NO_FONT_INTERFACE_DEFAULT').
+	See the interface in 'FontEngineInterfaceBitmap.h' and the implementation in 'FontEngineBitmap.h'.
+
+*/
+
 Rml::Core::Context* context = nullptr;
 
 ShellRenderInterfaceExtensions *shell_renderer;
@@ -87,6 +98,10 @@ int main(int RMLUI_UNUSED_PARAMETER(argc), char** RMLUI_UNUSED_PARAMETER(argv))
 	ShellSystemInterface system_interface;
 	Rml::Core::SetSystemInterface(&system_interface);
 
+	// Construct and load the font interface.
+	FontEngineInterfaceBitmap font_interface;
+	Rml::Core::SetFontEngineInterface(&font_interface);
+
 	Rml::Core::Initialise();
 
 	// Create the main RmlUi context and set it on the shell's input layer.
@@ -103,11 +118,21 @@ int main(int RMLUI_UNUSED_PARAMETER(argc), char** RMLUI_UNUSED_PARAMETER(argv))
 	shell_renderer->SetContext(context);
 
     // Load bitmap font
-    Rml::Core::LoadFontFace("assets/Arial.fnt");
-	
-    // Load and show the demo document.
-	if(Rml::Core::ElementDocument* document = context->LoadDocument("assets/bitmapfont.rml"))
+	if (!Rml::Core::LoadFontFace("basic/bitmapfont/data/Comfortaa_Regular_22.fnt"))
+	{
+		Rml::Core::Shutdown();
+		Shell::Shutdown();
+		return -1;
+	}
+
+	// Load and show the demo document.
+	if (Rml::Core::ElementDocument * document = context->LoadDocument("basic/bitmapfont/data/bitmapfont.rml"))
+	{
+		if (auto el = document->GetElementById("title"))
+			el->SetInnerRML("Bitmap font");
+
 		document->Show();
+	}
 
 	Shell::EventLoop(GameLoop);