@glassly/bluetooth-sdk 0.1.0-dev.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (548) hide show
  1. package/README.md +563 -0
  2. package/android/build.gradle +450 -0
  3. package/android/gradle.properties.example +9 -0
  4. package/android/lc3Lib/CMakeLists.txt +6 -0
  5. package/android/lc3Lib/build.gradle +212 -0
  6. package/android/lc3Lib/proguard-rules.pro +33 -0
  7. package/android/lc3Lib/src/main/AndroidManifest.xml +2 -0
  8. package/android/lc3Lib/src/main/cpp/CMakeLists.txt +8 -0
  9. package/android/lc3Lib/src/main/cpp/google_opus_stuff/CMakeLists.txt +30 -0
  10. package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/CMakeLists.txt +7 -0
  11. package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/ogg_opus_encoder.cc +96 -0
  12. package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/ogg_opus_encoder.h +53 -0
  13. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/Makefile.am +6 -0
  14. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/config_types.h +26 -0
  15. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/config_types.h.in +26 -0
  16. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/ogg.h +209 -0
  17. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/os_types.h +158 -0
  18. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus.h +981 -0
  19. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_custom.h +342 -0
  20. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_defines.h +799 -0
  21. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_multistream.h +660 -0
  22. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_projection.h +568 -0
  23. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_types.h +166 -0
  24. package/android/lc3Lib/src/main/cpp/google_opus_stuff/ogg_opus_encoder.cc +268 -0
  25. package/android/lc3Lib/src/main/cpp/google_opus_stuff/ogg_opus_encoder.h +115 -0
  26. package/android/lc3Lib/src/main/cpp/google_opus_stuff/opus_tools/opus_header.h +59 -0
  27. package/android/lc3Lib/src/main/cpp/liblc3/CMakeLists.txt +38 -0
  28. package/android/lc3Lib/src/main/cpp/liblc3/include/lc3.h +309 -0
  29. package/android/lc3Lib/src/main/cpp/liblc3/include/lc3_private.h +162 -0
  30. package/android/lc3Lib/src/main/cpp/liblc3/include/rnnoise.h +114 -0
  31. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/CMakeLists.txt +19 -0
  32. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/attdet.c +92 -0
  33. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/attdet.h +44 -0
  34. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bits.c +375 -0
  35. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bits.h +315 -0
  36. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bwdet.c +129 -0
  37. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bwdet.h +69 -0
  38. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/common.h +148 -0
  39. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/energy.c +70 -0
  40. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/energy.h +43 -0
  41. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/fastmath.h +158 -0
  42. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/lc3.c +702 -0
  43. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf.c +893 -0
  44. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf.h +111 -0
  45. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf_arm.h +506 -0
  46. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf_neon.h +281 -0
  47. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/makefile.mk +35 -0
  48. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct.c +452 -0
  49. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct.h +57 -0
  50. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct_neon.h +296 -0
  51. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/meson.build +46 -0
  52. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/plc.c +61 -0
  53. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/plc.h +57 -0
  54. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/sns.c +880 -0
  55. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/sns.h +103 -0
  56. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/spec.c +904 -0
  57. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/spec.h +119 -0
  58. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tables.c +3457 -0
  59. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tables.h +94 -0
  60. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tns.c +457 -0
  61. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tns.h +99 -0
  62. package/android/lc3Lib/src/main/cpp/liblc3/liblc3.cpp +159 -0
  63. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/_kiss_fft_guts.h +182 -0
  64. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/arch.h +261 -0
  65. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/celt_lpc.c +279 -0
  66. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/celt_lpc.h +59 -0
  67. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/common.h +48 -0
  68. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/compile.sh +3 -0
  69. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/denoise.c +646 -0
  70. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/kiss_fft.c +601 -0
  71. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/kiss_fft.h +203 -0
  72. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/opus_types.h +159 -0
  73. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/pitch.c +526 -0
  74. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/pitch.h +149 -0
  75. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn.c +178 -0
  76. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn.h +69 -0
  77. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_data.c +11051 -0
  78. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_data.h +34 -0
  79. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_reader.c +168 -0
  80. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_train.py +66 -0
  81. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/tansig_table.h +45 -0
  82. package/android/lc3Lib/src/main/java/com/glassly/lc3Lib/Lc3Cpp.java +38 -0
  83. package/android/lc3Lib/third_party/CMakeLists.txt +23 -0
  84. package/android/lc3Lib/third_party/CMakeLists_libogg.txt +18 -0
  85. package/android/lc3Lib/third_party/CMakeLists_libopus.txt +18 -0
  86. package/android/lc3Lib/third_party/CMakeLists_opus-tools.txt +23 -0
  87. package/android/lc3Lib/third_party/opus_tools/src/AUTHORS +5 -0
  88. package/android/lc3Lib/third_party/opus_tools/src/CMakeLists.txt +4 -0
  89. package/android/lc3Lib/third_party/opus_tools/src/COPYING +371 -0
  90. package/android/lc3Lib/third_party/opus_tools/src/ChangeLog +3 -0
  91. package/android/lc3Lib/third_party/opus_tools/src/Makefile.am +42 -0
  92. package/android/lc3Lib/third_party/opus_tools/src/Makefile.unix +23 -0
  93. package/android/lc3Lib/third_party/opus_tools/src/NEWS +0 -0
  94. package/android/lc3Lib/third_party/opus_tools/src/README +0 -0
  95. package/android/lc3Lib/third_party/opus_tools/src/autogen.sh +115 -0
  96. package/android/lc3Lib/third_party/opus_tools/src/configure.ac +293 -0
  97. package/android/lc3Lib/third_party/opus_tools/src/src/arch.h +239 -0
  98. package/android/lc3Lib/third_party/opus_tools/src/src/audio-in.c +1046 -0
  99. package/android/lc3Lib/third_party/opus_tools/src/src/diag_range.c +245 -0
  100. package/android/lc3Lib/third_party/opus_tools/src/src/diag_range.h +28 -0
  101. package/android/lc3Lib/third_party/opus_tools/src/src/info_opus.c +320 -0
  102. package/android/lc3Lib/third_party/opus_tools/src/src/info_opus.h +51 -0
  103. package/android/lc3Lib/third_party/opus_tools/src/src/lpc.c +157 -0
  104. package/android/lc3Lib/third_party/opus_tools/src/src/lpc.h +27 -0
  105. package/android/lc3Lib/third_party/opus_tools/src/src/opus_header.c +286 -0
  106. package/android/lc3Lib/third_party/opus_tools/src/src/opus_header.h +59 -0
  107. package/android/lc3Lib/third_party/opus_tools/src/src/opusdec.c +884 -0
  108. package/android/lc3Lib/third_party/opus_tools/src/src/opusenc.c +1021 -0
  109. package/android/lc3Lib/third_party/opus_tools/src/src/opusenc.h +101 -0
  110. package/android/lc3Lib/third_party/opus_tools/src/src/opusinfo.c +639 -0
  111. package/android/lc3Lib/third_party/opus_tools/src/src/opusinfo.h +51 -0
  112. package/android/lc3Lib/third_party/opus_tools/src/src/os_support.h +167 -0
  113. package/android/lc3Lib/third_party/opus_tools/src/src/resample.c +1137 -0
  114. package/android/lc3Lib/third_party/opus_tools/src/src/speex_resampler.h +344 -0
  115. package/android/lc3Lib/third_party/opus_tools/src/src/stack_alloc.h +115 -0
  116. package/android/lc3Lib/third_party/opus_tools/src/src/wav_io.c +125 -0
  117. package/android/lc3Lib/third_party/opus_tools/src/src/wav_io.h +62 -0
  118. package/android/lc3Lib/third_party/opus_tools/src/src/wave_out.c +223 -0
  119. package/android/lc3Lib/third_party/opus_tools/src/src/wave_out.h +60 -0
  120. package/android/settings.gradle +4 -0
  121. package/android/silero/LICENSE.md +17 -0
  122. package/android/silero/build.gradle +50 -0
  123. package/android/silero/proguard-rules.pro +24 -0
  124. package/android/silero/src/androidTest/assets/hello.wav +0 -0
  125. package/android/silero/src/androidTest/java/com/konovalov/vad/silero/VadSileroTest.kt +79 -0
  126. package/android/silero/src/main/assets/LICENSE +21 -0
  127. package/android/silero/src/main/assets/silero_vad.onnx +0 -0
  128. package/android/silero/src/main/java/com/konovalov/vad/silero/Vad.kt +160 -0
  129. package/android/silero/src/main/java/com/konovalov/vad/silero/VadSilero.kt +449 -0
  130. package/android/silero/src/main/java/com/konovalov/vad/silero/config/FrameSize.kt +15 -0
  131. package/android/silero/src/main/java/com/konovalov/vad/silero/config/Mode.kt +14 -0
  132. package/android/silero/src/main/java/com/konovalov/vad/silero/config/SampleRate.kt +12 -0
  133. package/android/silero/src/main/java/com/konovalov/vad/silero/utils/AudioUtils.kt +47 -0
  134. package/android/silero/src/main/java/com/konovalov/vad/silero/utils/TensorMap.kt +41 -0
  135. package/android/silero/src/test/java/com/konovalov/vad/silero/utils/AudioUtilsTest.kt +44 -0
  136. package/android/src/main/AndroidManifest.xml +42 -0
  137. package/android/src/main/assets/G2Firmware/README.md +11 -0
  138. package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdk.kt +2325 -0
  139. package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkAnalytics.kt +216 -0
  140. package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkDebug.kt +14 -0
  141. package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkDefaults.kt +7 -0
  142. package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkModule.kt +1088 -0
  143. package/android/src/main/java/com/glassly/bluetoothsdk/Bridge.kt +953 -0
  144. package/android/src/main/java/com/glassly/bluetoothsdk/DeviceManager.kt +2528 -0
  145. package/android/src/main/java/com/glassly/bluetoothsdk/DeviceStore.kt +360 -0
  146. package/android/src/main/java/com/glassly/bluetoothsdk/GeneratedChangelogCatalog.kt +8 -0
  147. package/android/src/main/java/com/glassly/bluetoothsdk/GeneratedReleaseMetadata.kt +11 -0
  148. package/android/src/main/java/com/glassly/bluetoothsdk/LocalNetworkModule.kt +414 -0
  149. package/android/src/main/java/com/glassly/bluetoothsdk/ObservableStore.kt +88 -0
  150. package/android/src/main/java/com/glassly/bluetoothsdk/OtaManifest.kt +191 -0
  151. package/android/src/main/java/com/glassly/bluetoothsdk/ReleaseChangelog.kt +61 -0
  152. package/android/src/main/java/com/glassly/bluetoothsdk/ScopedNetworkReadiness.kt +17 -0
  153. package/android/src/main/java/com/glassly/bluetoothsdk/audio/AudioModels.kt +144 -0
  154. package/android/src/main/java/com/glassly/bluetoothsdk/camera/CameraModels.kt +486 -0
  155. package/android/src/main/java/com/glassly/bluetoothsdk/connection/ConnectionModels.kt +78 -0
  156. package/android/src/main/java/com/glassly/bluetoothsdk/controllers/ControllerManager.kt +158 -0
  157. package/android/src/main/java/com/glassly/bluetoothsdk/controllers/R1.kt +937 -0
  158. package/android/src/main/java/com/glassly/bluetoothsdk/debug/BleTraceLogger.kt +165 -0
  159. package/android/src/main/java/com/glassly/bluetoothsdk/events/BluetoothEvents.kt +178 -0
  160. package/android/src/main/java/com/glassly/bluetoothsdk/internal/MapParsing.kt +140 -0
  161. package/android/src/main/java/com/glassly/bluetoothsdk/net/LocalIpv4.kt +57 -0
  162. package/android/src/main/java/com/glassly/bluetoothsdk/otaserver/LocalOtaServer.kt +304 -0
  163. package/android/src/main/java/com/glassly/bluetoothsdk/otaserver/OtaServerModule.kt +120 -0
  164. package/android/src/main/java/com/glassly/bluetoothsdk/photoreceiver/LocalPhotoReceiverRegistry.java +108 -0
  165. package/android/src/main/java/com/glassly/bluetoothsdk/photoreceiver/LocalPhotoUploadServer.kt +622 -0
  166. package/android/src/main/java/com/glassly/bluetoothsdk/photoreceiver/PhotoReceiverModule.kt +156 -0
  167. package/android/src/main/java/com/glassly/bluetoothsdk/requests/DisplayRequests.kt +56 -0
  168. package/android/src/main/java/com/glassly/bluetoothsdk/services/Foreground.kt +272 -0
  169. package/android/src/main/java/com/glassly/bluetoothsdk/services/PhoneMic.kt +1195 -0
  170. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Ar99.java +2653 -0
  171. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/BesOtaHeartbeatGuard.kt +49 -0
  172. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/BesOtaProgressMapper.kt +27 -0
  173. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G1.kt +3878 -0
  174. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G1TextSanitizer.kt +38 -0
  175. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2.kt +6428 -0
  176. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2CfwClassification.kt +49 -0
  177. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2CfwRenderer.kt +1241 -0
  178. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2CfwTextureCache.kt +270 -0
  179. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2FlashProtocol.kt +291 -0
  180. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2Flasher.kt +411 -0
  181. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/GlasslyBle.java +43189 -0
  182. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Mach1.kt +1280 -0
  183. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraLive.kt +10817 -0
  184. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraLiveL2capChannel.kt +274 -0
  185. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraLivePairingAdvertisement.kt +54 -0
  186. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraNex.kt +2011 -0
  187. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Nimo.kt +2532 -0
  188. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/SGCManager.kt +470 -0
  189. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Simulated.kt +228 -0
  190. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/Ar99OtaManager.java +566 -0
  191. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaByteUtils.java +18 -0
  192. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaCommandConstants.java +35 -0
  193. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaCrc32Util.java +13 -0
  194. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaGattTransport.java +11 -0
  195. package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaProtocol.java +92 -0
  196. package/android/src/main/java/com/glassly/bluetoothsdk/speakerid/SpeakerIdEngine.kt +525 -0
  197. package/android/src/main/java/com/glassly/bluetoothsdk/status/DeviceStatus.kt +669 -0
  198. package/android/src/main/java/com/glassly/bluetoothsdk/status/RuntimeState.kt +201 -0
  199. package/android/src/main/java/com/glassly/bluetoothsdk/status/WifiHotspotStatus.kt +189 -0
  200. package/android/src/main/java/com/glassly/bluetoothsdk/streaming/StreamModels.kt +518 -0
  201. package/android/src/main/java/com/glassly/bluetoothsdk/stt/STTTools.kt +391 -0
  202. package/android/src/main/java/com/glassly/bluetoothsdk/stt/SherpaOnnxTranscriber.kt +518 -0
  203. package/android/src/main/java/com/glassly/bluetoothsdk/stt/VadGateSpeechPolicy.kt +229 -0
  204. package/android/src/main/java/com/glassly/bluetoothsdk/tts/TTSTools.kt +248 -0
  205. package/android/src/main/java/com/glassly/bluetoothsdk/types/DeviceModels.kt +96 -0
  206. package/android/src/main/java/com/glassly/bluetoothsdk/utils/AES.java +106 -0
  207. package/android/src/main/java/com/glassly/bluetoothsdk/utils/AudioSessionMonitor.kt +189 -0
  208. package/android/src/main/java/com/glassly/bluetoothsdk/utils/AvifExifStripper.java +573 -0
  209. package/android/src/main/java/com/glassly/bluetoothsdk/utils/BitmapJavaUtils.java +169 -0
  210. package/android/src/main/java/com/glassly/bluetoothsdk/utils/BleJsonCompact.java +496 -0
  211. package/android/src/main/java/com/glassly/bluetoothsdk/utils/BlePhotoUploadService.java +677 -0
  212. package/android/src/main/java/com/glassly/bluetoothsdk/utils/BleWireProtocol.java +108 -0
  213. package/android/src/main/java/com/glassly/bluetoothsdk/utils/Constants.kt +46 -0
  214. package/android/src/main/java/com/glassly/bluetoothsdk/utils/G1Text.kt +436 -0
  215. package/android/src/main/java/com/glassly/bluetoothsdk/utils/HeifExifTagReader.java +199 -0
  216. package/android/src/main/java/com/glassly/bluetoothsdk/utils/IncidentLogBleRelayNaming.java +29 -0
  217. package/android/src/main/java/com/glassly/bluetoothsdk/utils/IncidentLogBleUploadService.java +77 -0
  218. package/android/src/main/java/com/glassly/bluetoothsdk/utils/K900LengthCodec.java +115 -0
  219. package/android/src/main/java/com/glassly/bluetoothsdk/utils/K900ProtocolUtils.java +827 -0
  220. package/android/src/main/java/com/glassly/bluetoothsdk/utils/MessageChunkReassembler.java +228 -0
  221. package/android/src/main/java/com/glassly/bluetoothsdk/utils/MessageChunker.java +325 -0
  222. package/android/src/main/java/com/glassly/bluetoothsdk/utils/NexSGCUtils.kt +698 -0
  223. package/android/src/main/java/com/glassly/bluetoothsdk/utils/PhoneAudioMonitor.kt +348 -0
  224. package/android/src/main/java/com/glassly/bluetoothsdk/utils/SmartGlassesConnectionState.java +9 -0
  225. package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/Ar99OpusPcmDecoder.java +398 -0
  226. package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/ByteUtilAudioPlayer.java +655 -0
  227. package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/Lc3Player.java +441 -0
  228. package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/PCMAudioPlayer.java +431 -0
  229. package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/PcmStreamPlayer.kt +328 -0
  230. package/android/src/main/res/values/strings.xml +4 -0
  231. package/android/src/test/java/com/glassly/bluetoothsdk/BluetoothSdkExceptionTest.kt +18 -0
  232. package/android/src/test/java/com/glassly/bluetoothsdk/OtaManifestDowngradeTest.kt +86 -0
  233. package/android/src/test/java/com/glassly/bluetoothsdk/OtaStartResponsePolicyTest.kt +30 -0
  234. package/android/src/test/java/com/glassly/bluetoothsdk/ReleaseChangelogTest.kt +13 -0
  235. package/android/src/test/java/com/glassly/bluetoothsdk/ScopedNetworkReadinessTest.kt +39 -0
  236. package/android/src/test/java/com/glassly/bluetoothsdk/StreamStatusEventTest.kt +29 -0
  237. package/android/src/test/java/com/glassly/bluetoothsdk/camera/PhotoRequestTest.kt +141 -0
  238. package/android/src/test/java/com/glassly/bluetoothsdk/otaserver/LocalOtaServerTest.kt +82 -0
  239. package/android/src/test/java/com/glassly/bluetoothsdk/photoreceiver/LocalPhotoReceiverRegistryTest.java +75 -0
  240. package/android/src/test/java/com/glassly/bluetoothsdk/services/ForegroundServiceTypeTest.kt +69 -0
  241. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/Ar99AdvertisementMatcherTest.java +22 -0
  242. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/BesOtaHeartbeatGuardTest.kt +73 -0
  243. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/BesOtaProgressMapperTest.kt +67 -0
  244. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/EvenRleTest.kt +63 -0
  245. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G1TextSanitizerTest.kt +31 -0
  246. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2CfwClassificationTest.kt +89 -0
  247. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2CfwRendererTest.kt +344 -0
  248. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2CfwTextureCacheTest.kt +200 -0
  249. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2FlashProtocolTest.kt +131 -0
  250. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/MentraLiveGattCharacteristicsTest.kt +39 -0
  251. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/MentraLivePairingAdvertisementParserTest.kt +133 -0
  252. package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/NimoProtocolTest.kt +333 -0
  253. package/android/src/test/java/com/glassly/bluetoothsdk/utils/AvifExifStripperTest.java +46 -0
  254. package/android/src/test/java/com/glassly/bluetoothsdk/utils/BinaryMessageChunkerTest.java +84 -0
  255. package/android/src/test/java/com/glassly/bluetoothsdk/utils/BleJsonCompactTest.java +319 -0
  256. package/android/src/test/java/com/glassly/bluetoothsdk/utils/BlePhotoUploadServiceTest.java +107 -0
  257. package/android/src/test/java/com/glassly/bluetoothsdk/utils/K900ProtocolUtilsEndiannessTest.java +172 -0
  258. package/android/src/test/java/com/glassly/bluetoothsdk/utils/K900ProtocolUtilsTest.java +24 -0
  259. package/android/src/test/java/com/glassly/bluetoothsdk/utils/PhoneAudioMonitorTest.kt +45 -0
  260. package/android/src/test/resources/avif_with_exif.avif +0 -0
  261. package/app.plugin.js +3 -0
  262. package/build/BluetoothSdk.types.d.ts +1354 -0
  263. package/build/BluetoothSdk.types.d.ts.map +1 -0
  264. package/build/BluetoothSdk.types.js +41 -0
  265. package/build/BluetoothSdk.types.js.map +1 -0
  266. package/build/_internal.d.ts +17 -0
  267. package/build/_internal.d.ts.map +1 -0
  268. package/build/_internal.js +16 -0
  269. package/build/_internal.js.map +1 -0
  270. package/build/_private/BluetoothSdkModule.d.ts +172 -0
  271. package/build/_private/BluetoothSdkModule.d.ts.map +1 -0
  272. package/build/_private/BluetoothSdkModule.js +300 -0
  273. package/build/_private/BluetoothSdkModule.js.map +1 -0
  274. package/build/_private/LocalNetworkModule.d.ts +38 -0
  275. package/build/_private/LocalNetworkModule.d.ts.map +1 -0
  276. package/build/_private/LocalNetworkModule.js +3 -0
  277. package/build/_private/LocalNetworkModule.js.map +1 -0
  278. package/build/_private/cameraRequestPayload.d.ts +4 -0
  279. package/build/_private/cameraRequestPayload.d.ts.map +1 -0
  280. package/build/_private/cameraRequestPayload.js +32 -0
  281. package/build/_private/cameraRequestPayload.js.map +1 -0
  282. package/build/_private/photoRequestPayload.d.ts +6 -0
  283. package/build/_private/photoRequestPayload.d.ts.map +1 -0
  284. package/build/_private/photoRequestPayload.js +86 -0
  285. package/build/_private/photoRequestPayload.js.map +1 -0
  286. package/build/_private/sdkOtaManifest.d.ts +11 -0
  287. package/build/_private/sdkOtaManifest.d.ts.map +1 -0
  288. package/build/_private/sdkOtaManifest.js +15 -0
  289. package/build/_private/sdkOtaManifest.js.map +1 -0
  290. package/build/changelogs.d.ts +7 -0
  291. package/build/changelogs.d.ts.map +1 -0
  292. package/build/changelogs.js +46 -0
  293. package/build/changelogs.js.map +1 -0
  294. package/build/debug.d.ts +3 -0
  295. package/build/debug.d.ts.map +1 -0
  296. package/build/debug.js +8 -0
  297. package/build/debug.js.map +1 -0
  298. package/build/generated/changelogCatalog.d.ts +9 -0
  299. package/build/generated/changelogCatalog.d.ts.map +1 -0
  300. package/build/generated/changelogCatalog.js +12 -0
  301. package/build/generated/changelogCatalog.js.map +1 -0
  302. package/build/generated/releaseMetadata.d.ts +12 -0
  303. package/build/generated/releaseMetadata.d.ts.map +1 -0
  304. package/build/generated/releaseMetadata.js +10 -0
  305. package/build/generated/releaseMetadata.js.map +1 -0
  306. package/build/index.d.ts +6 -0
  307. package/build/index.d.ts.map +1 -0
  308. package/build/index.js +171 -0
  309. package/build/index.js.map +1 -0
  310. package/build/ota-server/OtaServer.types.d.ts +14 -0
  311. package/build/ota-server/OtaServer.types.d.ts.map +1 -0
  312. package/build/ota-server/OtaServer.types.js +2 -0
  313. package/build/ota-server/OtaServer.types.js.map +1 -0
  314. package/build/ota-server/OtaServerModule.d.ts +21 -0
  315. package/build/ota-server/OtaServerModule.d.ts.map +1 -0
  316. package/build/ota-server/OtaServerModule.js +3 -0
  317. package/build/ota-server/OtaServerModule.js.map +1 -0
  318. package/build/ota-server/OtaServerModule.web.d.ts +10 -0
  319. package/build/ota-server/OtaServerModule.web.d.ts.map +1 -0
  320. package/build/ota-server/OtaServerModule.web.js +12 -0
  321. package/build/ota-server/OtaServerModule.web.js.map +1 -0
  322. package/build/ota-server/index.d.ts +3 -0
  323. package/build/ota-server/index.d.ts.map +1 -0
  324. package/build/ota-server/index.js +3 -0
  325. package/build/ota-server/index.js.map +1 -0
  326. package/build/ota-transport/index.d.ts +67 -0
  327. package/build/ota-transport/index.d.ts.map +1 -0
  328. package/build/ota-transport/index.js +58 -0
  329. package/build/ota-transport/index.js.map +1 -0
  330. package/build/photo-receiver/PhotoReceiver.types.d.ts +18 -0
  331. package/build/photo-receiver/PhotoReceiver.types.d.ts.map +1 -0
  332. package/build/photo-receiver/PhotoReceiver.types.js +2 -0
  333. package/build/photo-receiver/PhotoReceiver.types.js.map +1 -0
  334. package/build/photo-receiver/PhotoReceiverModule.d.ts +10 -0
  335. package/build/photo-receiver/PhotoReceiverModule.d.ts.map +1 -0
  336. package/build/photo-receiver/PhotoReceiverModule.js +3 -0
  337. package/build/photo-receiver/PhotoReceiverModule.js.map +1 -0
  338. package/build/photo-receiver/PhotoReceiverModule.web.d.ts +10 -0
  339. package/build/photo-receiver/PhotoReceiverModule.web.d.ts.map +1 -0
  340. package/build/photo-receiver/PhotoReceiverModule.web.js +12 -0
  341. package/build/photo-receiver/PhotoReceiverModule.web.js.map +1 -0
  342. package/build/photo-receiver/index.d.ts +3 -0
  343. package/build/photo-receiver/index.d.ts.map +1 -0
  344. package/build/photo-receiver/index.js +3 -0
  345. package/build/photo-receiver/index.js.map +1 -0
  346. package/build/react/index.d.ts +5 -0
  347. package/build/react/index.d.ts.map +1 -0
  348. package/build/react/index.js +4 -0
  349. package/build/react/index.js.map +1 -0
  350. package/build/react/useBluetooth.d.ts +100 -0
  351. package/build/react/useBluetooth.d.ts.map +1 -0
  352. package/build/react/useBluetooth.js +167 -0
  353. package/build/react/useBluetooth.js.map +1 -0
  354. package/build/react/useBluetoothEvent.d.ts +6 -0
  355. package/build/react/useBluetoothEvent.d.ts.map +1 -0
  356. package/build/react/useBluetoothEvent.js +21 -0
  357. package/build/react/useBluetoothEvent.js.map +1 -0
  358. package/build/react/useBluetoothScan.d.ts +22 -0
  359. package/build/react/useBluetoothScan.d.ts.map +1 -0
  360. package/build/react/useBluetoothScan.js +135 -0
  361. package/build/react/useBluetoothScan.js.map +1 -0
  362. package/build/react/useBluetoothStatus.d.ts +16 -0
  363. package/build/react/useBluetoothStatus.d.ts.map +1 -0
  364. package/build/react/useBluetoothStatus.js +137 -0
  365. package/build/react/useBluetoothStatus.js.map +1 -0
  366. package/build/react/useGlassesConnection.d.ts +29 -0
  367. package/build/react/useGlassesConnection.d.ts.map +1 -0
  368. package/build/react/useGlassesConnection.js +153 -0
  369. package/build/react/useGlassesConnection.js.map +1 -0
  370. package/build/types/index.d.ts +3 -0
  371. package/build/types/index.d.ts.map +1 -0
  372. package/build/types/index.js +2 -0
  373. package/build/types/index.js.map +1 -0
  374. package/expo-module.config.json +14 -0
  375. package/ios/BackgroundOtaArtifactDownloader.swift +125 -0
  376. package/ios/BluetoothSdkModule.swift +1034 -0
  377. package/ios/GlasslyBluetoothSDK.podspec +106 -0
  378. package/ios/LocalIPv4.swift +150 -0
  379. package/ios/LocalOtaServer.swift +309 -0
  380. package/ios/LocalPhotoUploadServer.swift +754 -0
  381. package/ios/OtaServerModule.swift +147 -0
  382. package/ios/Packages/CoreObjC/CoreObjC.xcodeproj/project.pbxproj +213 -0
  383. package/ios/Packages/CoreObjC/PcmConverter.h +22 -0
  384. package/ios/Packages/CoreObjC/PcmConverter.m +266 -0
  385. package/ios/Packages/CoreObjC/attdet.c +92 -0
  386. package/ios/Packages/CoreObjC/attdet.h +44 -0
  387. package/ios/Packages/CoreObjC/bits.c +375 -0
  388. package/ios/Packages/CoreObjC/bits.h +315 -0
  389. package/ios/Packages/CoreObjC/bwdet.c +129 -0
  390. package/ios/Packages/CoreObjC/bwdet.h +69 -0
  391. package/ios/Packages/CoreObjC/common.h +151 -0
  392. package/ios/Packages/CoreObjC/energy.c +70 -0
  393. package/ios/Packages/CoreObjC/energy.h +43 -0
  394. package/ios/Packages/CoreObjC/fastmath.h +158 -0
  395. package/ios/Packages/CoreObjC/include/PcmConverter.h +22 -0
  396. package/ios/Packages/CoreObjC/lc3.c +704 -0
  397. package/ios/Packages/CoreObjC/lc3.h +313 -0
  398. package/ios/Packages/CoreObjC/lc3_cpp.h +283 -0
  399. package/ios/Packages/CoreObjC/lc3_private.h +163 -0
  400. package/ios/Packages/CoreObjC/ltpf.c +905 -0
  401. package/ios/Packages/CoreObjC/ltpf.h +111 -0
  402. package/ios/Packages/CoreObjC/ltpf_arm.h +506 -0
  403. package/ios/Packages/CoreObjC/ltpf_neon.h +281 -0
  404. package/ios/Packages/CoreObjC/makefile.mk +35 -0
  405. package/ios/Packages/CoreObjC/mdct.c +469 -0
  406. package/ios/Packages/CoreObjC/mdct.h +57 -0
  407. package/ios/Packages/CoreObjC/mdct_neon.h +296 -0
  408. package/ios/Packages/CoreObjC/meson.build +61 -0
  409. package/ios/Packages/CoreObjC/plc.c +61 -0
  410. package/ios/Packages/CoreObjC/plc.h +57 -0
  411. package/ios/Packages/CoreObjC/rnnoise.h +114 -0
  412. package/ios/Packages/CoreObjC/sns.c +880 -0
  413. package/ios/Packages/CoreObjC/sns.h +103 -0
  414. package/ios/Packages/CoreObjC/spec.c +907 -0
  415. package/ios/Packages/CoreObjC/spec.h +119 -0
  416. package/ios/Packages/CoreObjC/tables.c +3457 -0
  417. package/ios/Packages/CoreObjC/tables.h +94 -0
  418. package/ios/Packages/CoreObjC/tns.c +457 -0
  419. package/ios/Packages/CoreObjC/tns.h +99 -0
  420. package/ios/Packages/SherpaOnnx/Model/joiner.onnx +0 -0
  421. package/ios/Packages/SherpaOnnx/Model/tokens.txt +502 -0
  422. package/ios/Packages/SherpaOnnx/SherpaOnnx.swift +2383 -0
  423. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Info.plist +48 -0
  424. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/Headers/sherpa-onnx/c-api/c-api.h +4689 -0
  425. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/Headers/sherpa-onnx/c-api/cxx-api.h +2036 -0
  426. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/libsherpa-onnx.a +0 -0
  427. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/Headers/sherpa-onnx/c-api/c-api.h +4689 -0
  428. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/Headers/sherpa-onnx/c-api/cxx-api.h +2036 -0
  429. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/libsherpa-onnx.a +0 -0
  430. package/ios/Packages/libbz2/module.modulemap +5 -0
  431. package/ios/Packages/libbz2/shim.h +1 -0
  432. package/ios/PhotoReceiverModule.swift +129 -0
  433. package/ios/Source/BluetoothSDK.swift +2303 -0
  434. package/ios/Source/BluetoothSDKDebug.swift +12 -0
  435. package/ios/Source/BluetoothSdkDefaults.swift +29 -0
  436. package/ios/Source/Bridge.swift +708 -0
  437. package/ios/Source/Bridging-Header.h +16 -0
  438. package/ios/Source/DeviceManager.swift +2109 -0
  439. package/ios/Source/DeviceStore.swift +336 -0
  440. package/ios/Source/GeneratedChangelogCatalog.swift +7 -0
  441. package/ios/Source/GeneratedReleaseMetadata.swift +11 -0
  442. package/ios/Source/ObservableStore.swift +118 -0
  443. package/ios/Source/OtaManifest.swift +211 -0
  444. package/ios/Source/PrivacyInfo.xcprivacy +23 -0
  445. package/ios/Source/ReleaseChangelog.swift +65 -0
  446. package/ios/Source/Resources/G2Firmware/README.md +10 -0
  447. package/ios/Source/audio/AudioModels.swift +178 -0
  448. package/ios/Source/audio/PcmStreamPlayer.swift +410 -0
  449. package/ios/Source/camera/CameraModels.swift +866 -0
  450. package/ios/Source/connection/ScanSession.swift +27 -0
  451. package/ios/Source/controllers/ControllerManager.swift +184 -0
  452. package/ios/Source/controllers/R1.swift +829 -0
  453. package/ios/Source/errors/BluetoothSdkError.swift +19 -0
  454. package/ios/Source/events/BluetoothEvents.swift +342 -0
  455. package/ios/Source/internal/BleTraceLogger.swift +192 -0
  456. package/ios/Source/internal/BluetoothAvailability.swift +78 -0
  457. package/ios/Source/internal/BluetoothSdkAnalytics.swift +199 -0
  458. package/ios/Source/internal/ValueParsing.swift +99 -0
  459. package/ios/Source/requests/DisplayRequests.swift +82 -0
  460. package/ios/Source/services/PhoneMic.swift +662 -0
  461. package/ios/Source/sgcs/Ar99.swift +2451 -0
  462. package/ios/Source/sgcs/Frame.swift +649 -0
  463. package/ios/Source/sgcs/G1.swift +2554 -0
  464. package/ios/Source/sgcs/G2.swift +6887 -0
  465. package/ios/Source/sgcs/G2CfwClassification.swift +43 -0
  466. package/ios/Source/sgcs/G2CfwRenderer.swift +1279 -0
  467. package/ios/Source/sgcs/G2CfwTextureCache.swift +233 -0
  468. package/ios/Source/sgcs/G2FlashProtocol.swift +312 -0
  469. package/ios/Source/sgcs/G2Flasher.swift +773 -0
  470. package/ios/Source/sgcs/Mach1.swift +541 -0
  471. package/ios/Source/sgcs/MentraLive.swift +7011 -0
  472. package/ios/Source/sgcs/MentraLiveL2capChannel.swift +183 -0
  473. package/ios/Source/sgcs/MentraLivePairingAdvertisement.swift +64 -0
  474. package/ios/Source/sgcs/MentraNex.swift +3221 -0
  475. package/ios/Source/sgcs/Nimo.swift +1886 -0
  476. package/ios/Source/sgcs/SGCManager.swift +608 -0
  477. package/ios/Source/sgcs/Simulated.swift +274 -0
  478. package/ios/Source/sgcs/ar99/ota/Ar99OtaManager.swift +637 -0
  479. package/ios/Source/sgcs/glassly_ble.pb.swift +4354 -0
  480. package/ios/Source/speakerid/SpeakerIdEngine.swift +573 -0
  481. package/ios/Source/status/DeviceStatus.swift +981 -0
  482. package/ios/Source/status/RuntimeState.swift +359 -0
  483. package/ios/Source/status/WifiHotspotStatus.swift +345 -0
  484. package/ios/Source/streaming/StreamModels.swift +693 -0
  485. package/ios/Source/stt/STTTools.swift +191 -0
  486. package/ios/Source/stt/SherpaOnnxTranscriber.swift +466 -0
  487. package/ios/Source/tts/TTSTools.swift +171 -0
  488. package/ios/Source/types/DeviceModels.swift +177 -0
  489. package/ios/Source/utils/AudioSessionMonitor.swift +283 -0
  490. package/ios/Source/utils/BinaryCodec.swift +61 -0
  491. package/ios/Source/utils/BleJsonCompact.swift +405 -0
  492. package/ios/Source/utils/BleWireProtocol.swift +92 -0
  493. package/ios/Source/utils/Constants.swift +78 -0
  494. package/ios/Source/utils/Enums.swift +95 -0
  495. package/ios/Source/utils/G1Text.swift +2096 -0
  496. package/ios/Source/utils/JSCExperiment.swift +241 -0
  497. package/ios/Source/utils/MemoryMonitor.swift +44 -0
  498. package/ios/Source/utils/MessageChunkReassembler.swift +190 -0
  499. package/ios/Source/utils/MessageChunker.swift +294 -0
  500. package/ios/Source/utils/Models.swift +135 -0
  501. package/ios/Source/utils/PhoneAudioMonitor.swift +230 -0
  502. package/ios/Source/utils/TarBz2Extractor.swift +257 -0
  503. package/ios/Tests/BluetoothSDKTests/G2CfwClassificationTests.swift +78 -0
  504. package/ios/Tests/BluetoothSDKTests/G2CfwRendererTests.swift +372 -0
  505. package/ios/Tests/BluetoothSDKTests/G2CfwTextureCacheTests.swift +162 -0
  506. package/ios/Tests/BluetoothSDKTests/G2FlashProtocolTests.swift +182 -0
  507. package/ios/Tests/MentraLivePairingAdvertisementTests.swift +160 -0
  508. package/ios/Tests/ReleaseChangelogTests.swift +13 -0
  509. package/package.json +129 -0
  510. package/plugin/build/index.d.ts +10 -0
  511. package/plugin/build/index.js +12 -0
  512. package/plugin/build/withAndroid.d.ts +3 -0
  513. package/plugin/build/withAndroid.js +190 -0
  514. package/plugin/build/withIos.d.ts +5 -0
  515. package/plugin/build/withIos.js +108 -0
  516. package/scripts/inject-ios-sdk-version.mjs +65 -0
  517. package/scripts/public-ota-api.test.mjs +37 -0
  518. package/scripts/verify-release-package.mjs +45 -0
  519. package/scripts/write-release-metadata.mjs +152 -0
  520. package/scripts/write-release-metadata.test.mjs +37 -0
  521. package/src/BluetoothSdk.types.ts +1623 -0
  522. package/src/_internal.ts +16 -0
  523. package/src/_private/BluetoothSdkModule.ts +684 -0
  524. package/src/_private/LocalNetworkModule.ts +50 -0
  525. package/src/_private/cameraRequestPayload.ts +34 -0
  526. package/src/_private/photoRequestPayload.ts +90 -0
  527. package/src/_private/sdkOtaManifest.ts +18 -0
  528. package/src/changelogs.ts +46 -0
  529. package/src/debug.ts +9 -0
  530. package/src/generated/changelogCatalog.ts +13 -0
  531. package/src/generated/releaseMetadata.ts +20 -0
  532. package/src/index.ts +321 -0
  533. package/src/ota-server/OtaServer.types.ts +10 -0
  534. package/src/ota-server/OtaServerModule.ts +23 -0
  535. package/src/ota-server/OtaServerModule.web.ts +17 -0
  536. package/src/ota-server/index.ts +2 -0
  537. package/src/ota-transport/index.ts +116 -0
  538. package/src/photo-receiver/PhotoReceiver.types.ts +20 -0
  539. package/src/photo-receiver/PhotoReceiverModule.ts +11 -0
  540. package/src/photo-receiver/PhotoReceiverModule.web.ts +17 -0
  541. package/src/photo-receiver/index.ts +2 -0
  542. package/src/react/index.ts +21 -0
  543. package/src/react/useBluetooth.ts +309 -0
  544. package/src/react/useBluetoothEvent.ts +35 -0
  545. package/src/react/useBluetoothScan.ts +173 -0
  546. package/src/react/useBluetoothStatus.ts +180 -0
  547. package/src/react/useGlassesConnection.ts +202 -0
  548. package/src/types/index.ts +12 -0
@@ -0,0 +1,2096 @@
1
+ //
2
+ // G1Text.swift
3
+ // Glassly_Manager
4
+ //
5
+ // Created by Matthew Fosse on 3/5/25.
6
+ //
7
+
8
+ import CoreGraphics
9
+ import Foundation
10
+
11
+ class G1Text {
12
+ // Constants for text wall display
13
+ private static let TEXT_COMMAND: UInt8 = 0x4E // Text command
14
+ private static let DISPLAY_WIDTH = 488
15
+ private static let DISPLAY_USE_WIDTH = 488 // How much of the display to use
16
+ private static let FONT_MULTIPLIER: Float = 1 / 50.0
17
+ private static let OLD_FONT_SIZE = 21 // Font size
18
+ private static let FONT_DIVIDER: Float = 2.0
19
+ private static let LINES_PER_SCREEN = 5 // Lines per screen
20
+ private static let MAX_CHUNK_SIZE = 176 // Maximum chunk size for BLE packets
21
+
22
+ private var textSeqNum = 0 // Sequence number for text packets
23
+ private var fontLoader = G1FontLoader()
24
+
25
+ init() {}
26
+
27
+ /// Converts text to the base Latin glyphs available in G1 firmware.
28
+ /// Newer glasses bypass this G1-only transport and keep the original text.
29
+ static func sanitizeForDisplay(_ text: String) -> String {
30
+ let expanded = text.reduce(into: "") { result, character in
31
+ switch character {
32
+ case "Đ", "Ð": result.append("D")
33
+ case "đ", "ð": result.append("d")
34
+ case "Ł": result.append("L")
35
+ case "ł": result.append("l")
36
+ case "Ø": result.append("O")
37
+ case "ø": result.append("o")
38
+ case "Æ": result.append("AE")
39
+ case "æ": result.append("ae")
40
+ case "Œ": result.append("OE")
41
+ case "œ": result.append("oe")
42
+ case "ẞ": result.append("SS")
43
+ case "ß": result.append("ss")
44
+ case "Þ": result.append("TH")
45
+ case "þ": result.append("th")
46
+ default: result.append(character)
47
+ }
48
+ }
49
+
50
+ return expanded
51
+ .folding(options: .diacriticInsensitive, locale: Locale(identifier: "en_US_POSIX"))
52
+ }
53
+
54
+ // MARK: - Text Wall Methods
55
+
56
+ // func displayTextWall(_ text: String) {
57
+ // let chunks = createTextWallChunks(text)
58
+ // sendChunks(chunks)
59
+ // }
60
+
61
+ // func displayDoubleTextWall(textTop: String, textBottom: String) {
62
+ // let chunks = createDoubleTextWallChunks(textTop: textTop, textBottom: textBottom)
63
+ // sendChunks(chunks)
64
+ // }
65
+
66
+ /// Creates BLE chunks for pre-wrapped text.
67
+ ///
68
+ /// IMPORTANT: Text is expected to come pre-wrapped from the DisplayProcessor in React Native.
69
+ /// This function does NOT perform any text wrapping - it only chunks the text for BLE transmission.
70
+ /// The DisplayProcessor handles all pixel-accurate wrapping using @glassly/display-utils.
71
+ ///
72
+ /// - Parameter text: Pre-wrapped text with newlines already in place
73
+ /// - Returns: Array of BLE chunks ready for transmission
74
+ func createTextWallChunks(_ text: String) -> [[UInt8]] {
75
+ // Text comes pre-wrapped from DisplayProcessor - just chunk it for transmission
76
+ return chunkTextForTransmission(text)
77
+ }
78
+
79
+ /// Creates BLE chunks for pre-composed double text wall.
80
+ ///
81
+ /// NOTE: DisplayProcessor now composes double_text_wall into a single text_wall
82
+ /// with pixel-precise column alignment using ColumnComposer. This method may
83
+ /// not be called anymore for new flows, but is kept for backwards compatibility.
84
+ ///
85
+ /// Column composition is handled by DisplayProcessor in React Native.
86
+ /// This method is a "dumb pipe" - it just combines and chunks the text.
87
+ ///
88
+ /// - Parameters:
89
+ /// - textTop: Pre-composed left/top column text
90
+ /// - textBottom: Pre-composed right/bottom column text
91
+ /// - Returns: Array of BLE chunks ready for transmission
92
+ func createDoubleTextWallChunks(textTop: String, textBottom: String) -> [[UInt8]] {
93
+ // Text is already composed by DisplayProcessor's ColumnComposer
94
+ // Just combine and chunk for transmission - no custom wrapping logic needed
95
+ let combinedText = "\(textTop)\n\(textBottom)"
96
+ return chunkTextForTransmission(combinedText)
97
+ }
98
+
99
+ func chunkTextForTransmission(_ text: String) -> [[UInt8]] {
100
+ // Handle empty or whitespace-only text by sending at least a space
101
+ // This ensures the display gets updated/cleared properly
102
+ let textToSend = text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
103
+ ? " "
104
+ : G1Text.sanitizeForDisplay(text)
105
+ guard let textData = textToSend.data(using: .utf8) else { return [] }
106
+ let textBytes = [UInt8](textData)
107
+ let totalChunks = Int(ceil(Double(textBytes.count) / Double(G1Text.MAX_CHUNK_SIZE)))
108
+
109
+ var allChunks = [[UInt8]]()
110
+ for i in 0 ..< totalChunks {
111
+ let start = i * G1Text.MAX_CHUNK_SIZE
112
+ let end = min(start + G1Text.MAX_CHUNK_SIZE, textBytes.count)
113
+ let payloadChunk = Array(textBytes[start ..< end])
114
+
115
+ // Create header with protocol specifications
116
+ let screenStatus: UInt8 = 0x71 // New content (0x01) + Text Show (0x70)
117
+ let header: [UInt8] = [
118
+ G1Text.TEXT_COMMAND, // Command type
119
+ UInt8(textSeqNum), // Sequence number
120
+ UInt8(totalChunks), // Total packages
121
+ UInt8(i), // Current package number
122
+ screenStatus, // Screen status
123
+ 0x00, // new_char_pos0 (high)
124
+ 0x00, // new_char_pos1 (low)
125
+ 0x00, // Current page number (always 0 for now)
126
+ 0x01, // Max page number (always 1)
127
+ ]
128
+
129
+ // Combine header and payload
130
+ var chunk = header
131
+ chunk.append(contentsOf: payloadChunk)
132
+
133
+ allChunks.append(chunk)
134
+ }
135
+
136
+ // Increment sequence number for next page
137
+ textSeqNum = (textSeqNum + 1) % 256
138
+
139
+ return allChunks
140
+ }
141
+
142
+ private func calculateTextWidth(_ text: String) -> Int {
143
+ var width = 0
144
+ for char in text {
145
+ let glyph = fontLoader.getGlyph(char)
146
+ width += glyph.width + 1 // Add 1 pixel per character for spacing
147
+ }
148
+ return width * 2
149
+ }
150
+
151
+ private func calculateSubstringWidth(_ text: String, start: Int, end: Int) -> Int {
152
+ let startIndex = text.index(text.startIndex, offsetBy: start)
153
+ let endIndex = text.index(text.startIndex, offsetBy: end)
154
+ let substring = text[startIndex ..< endIndex]
155
+ return calculateTextWidth(String(substring))
156
+ }
157
+
158
+ private func calculateSpacesForAlignment(
159
+ currentWidth: Int, targetPosition: Int, spaceWidth: Int
160
+ ) -> Int {
161
+ // Calculate space needed in pixels
162
+ let pixelsNeeded = targetPosition - currentWidth
163
+
164
+ // Calculate spaces needed (with minimum of 1 space for separation)
165
+ if pixelsNeeded <= 0 {
166
+ return 1 // Ensure at least one space between columns
167
+ }
168
+
169
+ // Calculate the exact number of spaces needed
170
+ let spaces = Int(ceil(Double(pixelsNeeded) / Double(spaceWidth)))
171
+
172
+ // Cap at a reasonable maximum
173
+ return min(spaces, 100)
174
+ }
175
+
176
+ private func splitIntoLines(_ text: String, maxDisplayWidth: Int) -> [String] {
177
+ // Replace specific symbols
178
+ let processedText = text.replacingOccurrences(of: "⬆", with: "^").replacingOccurrences(
179
+ of: "⟶", with: "-"
180
+ )
181
+
182
+ var lines = [String]()
183
+
184
+ // Handle empty or single space case
185
+ if processedText.isEmpty || processedText == " " {
186
+ lines.append(processedText)
187
+ return lines
188
+ }
189
+
190
+ // Split by newlines first
191
+ let rawLines = processedText.components(separatedBy: "\n")
192
+
193
+ // print("Splitting text into lines...\(rawLines)")
194
+
195
+ for rawLine in rawLines {
196
+ // Add empty lines for newlines
197
+ if rawLine.isEmpty {
198
+ lines.append("")
199
+ continue
200
+ }
201
+
202
+ let lineLength = rawLine.count
203
+ var startIndex = 0
204
+
205
+ while startIndex < lineLength {
206
+ // Get maximum possible end index
207
+ let endIndex = lineLength
208
+
209
+ // Calculate width of the entire remaining text
210
+ let lineWidth = calculateSubstringWidth(rawLine, start: startIndex, end: endIndex)
211
+
212
+ // print("Line length: \(rawLine)")
213
+ // print("Calculating line width: \(lineWidth)")
214
+
215
+ // If entire line fits, add it and move to next line
216
+ if lineWidth <= maxDisplayWidth {
217
+ let startIndexChar = rawLine.index(rawLine.startIndex, offsetBy: startIndex)
218
+ lines.append(String(rawLine[startIndexChar...]))
219
+ break
220
+ }
221
+
222
+ // Binary search to find the maximum number of characters that fit
223
+ var left = startIndex + 1
224
+ var right = lineLength
225
+ var bestSplitIndex = startIndex + 1
226
+
227
+ while left <= right {
228
+ let mid = left + (right - left) / 2
229
+ let width = calculateSubstringWidth(rawLine, start: startIndex, end: mid)
230
+
231
+ if width <= maxDisplayWidth {
232
+ bestSplitIndex = mid
233
+ left = mid + 1
234
+ } else {
235
+ right = mid - 1
236
+ }
237
+ }
238
+
239
+ // Now find a good place to break (preferably at a space)
240
+ var splitIndex = bestSplitIndex
241
+
242
+ // Look for a space to break at
243
+ var foundSpace = false
244
+ for i in (startIndex + 1 ... bestSplitIndex).reversed() {
245
+ if i > 0, rawLine[rawLine.index(rawLine.startIndex, offsetBy: i - 1)] == " " {
246
+ splitIndex = i
247
+ foundSpace = true
248
+ break
249
+ }
250
+ }
251
+
252
+ // If we couldn't find a space in a reasonable range, use the calculated split point
253
+ if !foundSpace, bestSplitIndex - startIndex > 2 {
254
+ splitIndex = bestSplitIndex
255
+ }
256
+
257
+ // Add the line
258
+ let startChar = rawLine.index(rawLine.startIndex, offsetBy: startIndex)
259
+ let endChar = rawLine.index(rawLine.startIndex, offsetBy: splitIndex)
260
+ let line = String(rawLine[startChar ..< endChar]).trimmingCharacters(in: .whitespaces)
261
+ lines.append(line)
262
+
263
+ // Skip any spaces at the beginning of the next line
264
+ while splitIndex < lineLength,
265
+ rawLine[rawLine.index(rawLine.startIndex, offsetBy: splitIndex)] == " "
266
+ {
267
+ splitIndex += 1
268
+ }
269
+
270
+ startIndex = splitIndex
271
+ }
272
+ }
273
+
274
+ return lines
275
+ }
276
+ }
277
+
278
+ class G1FontLoader {
279
+ private var fontMap: [Character: FontGlyph] = [:]
280
+
281
+ init() {
282
+ // Initialize with hardcoded font data instead of loading from file
283
+ loadHardcodedFontData()
284
+ }
285
+
286
+ private func loadHardcodedFontData() {
287
+ // Hardcoded font data based on the JSON snippet
288
+ let hardcodedGlyphs: [[String: Any]] = [
289
+ [
290
+ "code_point": 32,
291
+ "char": " ",
292
+ "width": 2,
293
+ "height": 26,
294
+ ],
295
+ [
296
+ "code_point": 33,
297
+ "char": "!",
298
+ "width": 1,
299
+ "height": 26,
300
+ ],
301
+ [
302
+ "code_point": 34,
303
+ "char": "\"",
304
+ "width": 2,
305
+ "height": 26,
306
+ ],
307
+ [
308
+ "code_point": 35,
309
+ "char": "#",
310
+ "width": 6,
311
+ "height": 26,
312
+ ],
313
+ [
314
+ "code_point": 36,
315
+ "char": "$",
316
+ "width": 5,
317
+ "height": 26,
318
+ ],
319
+ [
320
+ "code_point": 37,
321
+ "char": "%",
322
+ "width": 6,
323
+ "height": 26,
324
+ ],
325
+ [
326
+ "code_point": 38,
327
+ "char": "&",
328
+ "width": 7,
329
+ "height": 26,
330
+ ],
331
+ [
332
+ "code_point": 39,
333
+ "char": "'",
334
+ "width": 1,
335
+ "height": 26,
336
+ ],
337
+ [
338
+ "code_point": 40,
339
+ "char": "(",
340
+ "width": 2,
341
+ "height": 26,
342
+ ],
343
+ [
344
+ "code_point": 41,
345
+ "char": ")",
346
+ "width": 2,
347
+ "height": 26,
348
+ ],
349
+ [
350
+ "code_point": 42,
351
+ "char": "*",
352
+ "width": 3,
353
+ "height": 26,
354
+ ],
355
+ [
356
+ "code_point": 43,
357
+ "char": "+",
358
+ "width": 4,
359
+ "height": 26,
360
+ ],
361
+ [
362
+ "code_point": 44,
363
+ "char": ",",
364
+ "width": 1,
365
+ "height": 26,
366
+ ],
367
+ [
368
+ "code_point": 45,
369
+ "char": "-",
370
+ "width": 4,
371
+ "height": 26,
372
+ ],
373
+ [
374
+ "code_point": 46,
375
+ "char": ".",
376
+ "width": 1,
377
+ "height": 26,
378
+ ],
379
+ [
380
+ "code_point": 47,
381
+ "char": "/",
382
+ "width": 3,
383
+ "height": 26,
384
+ ],
385
+ [
386
+ "code_point": 48,
387
+ "char": "0",
388
+ "width": 5,
389
+ "height": 26,
390
+ ],
391
+ [
392
+ "code_point": 49,
393
+ "char": "1",
394
+ "width": 3,
395
+ "height": 26,
396
+ ],
397
+ [
398
+ "code_point": 50,
399
+ "char": "2",
400
+ "width": 5,
401
+ "height": 26,
402
+ ],
403
+ [
404
+ "code_point": 51,
405
+ "char": "3",
406
+ "width": 5,
407
+ "height": 26,
408
+ ],
409
+ [
410
+ "code_point": 52,
411
+ "char": "4",
412
+ "width": 5,
413
+ "height": 26,
414
+ ],
415
+ [
416
+ "code_point": 53,
417
+ "char": "5",
418
+ "width": 5,
419
+ "height": 26,
420
+ ],
421
+ [
422
+ "code_point": 54,
423
+ "char": "6",
424
+ "width": 5,
425
+ "height": 26,
426
+ ],
427
+ [
428
+ "code_point": 55,
429
+ "char": "7",
430
+ "width": 5,
431
+ "height": 26,
432
+ ],
433
+ [
434
+ "code_point": 56,
435
+ "char": "8",
436
+ "width": 5,
437
+ "height": 26,
438
+ ],
439
+ [
440
+ "code_point": 57,
441
+ "char": "9",
442
+ "width": 5,
443
+ "height": 26,
444
+ ],
445
+ [
446
+ "code_point": 58,
447
+ "char": ":",
448
+ "width": 1,
449
+ "height": 26,
450
+ ],
451
+ [
452
+ "code_point": 59,
453
+ "char": ";",
454
+ "width": 1,
455
+ "height": 26,
456
+ ],
457
+ [
458
+ "code_point": 60,
459
+ "char": "<",
460
+ "width": 4,
461
+ "height": 26,
462
+ ],
463
+ [
464
+ "code_point": 61,
465
+ "char": "=",
466
+ "width": 4,
467
+ "height": 26,
468
+ ],
469
+ [
470
+ "code_point": 62,
471
+ "char": ">",
472
+ "width": 4,
473
+ "height": 26,
474
+ ],
475
+ [
476
+ "code_point": 63,
477
+ "char": "?",
478
+ "width": 5,
479
+ "height": 26,
480
+ ],
481
+ [
482
+ "code_point": 64,
483
+ "char": "@",
484
+ "width": 7,
485
+ "height": 26,
486
+ ],
487
+ [
488
+ "code_point": 65,
489
+ "char": "A",
490
+ "width": 6,
491
+ "height": 26,
492
+ ],
493
+ [
494
+ "code_point": 66,
495
+ "char": "B",
496
+ "width": 5,
497
+ "height": 26,
498
+ ],
499
+ [
500
+ "code_point": 67,
501
+ "char": "C",
502
+ "width": 5,
503
+ "height": 26,
504
+ ],
505
+ [
506
+ "code_point": 68,
507
+ "char": "D",
508
+ "width": 5,
509
+ "height": 26,
510
+ ],
511
+ [
512
+ "code_point": 69,
513
+ "char": "E",
514
+ "width": 4,
515
+ "height": 26,
516
+ ],
517
+ [
518
+ "code_point": 70,
519
+ "char": "F",
520
+ "width": 4,
521
+ "height": 26,
522
+ ],
523
+ [
524
+ "code_point": 71,
525
+ "char": "G",
526
+ "width": 5,
527
+ "height": 26,
528
+ ],
529
+ [
530
+ "code_point": 72,
531
+ "char": "H",
532
+ "width": 5,
533
+ "height": 26,
534
+ ],
535
+ [
536
+ "code_point": 73,
537
+ "char": "I",
538
+ "width": 2,
539
+ "height": 26,
540
+ ],
541
+ [
542
+ "code_point": 74,
543
+ "char": "J",
544
+ "width": 3,
545
+ "height": 26,
546
+ ],
547
+ [
548
+ "code_point": 75,
549
+ "char": "K",
550
+ "width": 5,
551
+ "height": 26,
552
+ ],
553
+ [
554
+ "code_point": 76,
555
+ "char": "L",
556
+ "width": 4,
557
+ "height": 26,
558
+ ],
559
+ [
560
+ "code_point": 77,
561
+ "char": "M",
562
+ "width": 7,
563
+ "height": 26,
564
+ ],
565
+ [
566
+ "code_point": 78,
567
+ "char": "N",
568
+ "width": 5,
569
+ "height": 26,
570
+ ],
571
+ [
572
+ "code_point": 79,
573
+ "char": "O",
574
+ "width": 5,
575
+ "height": 26,
576
+ ],
577
+ [
578
+ "code_point": 80,
579
+ "char": "P",
580
+ "width": 5,
581
+ "height": 26,
582
+ ],
583
+ [
584
+ "code_point": 81,
585
+ "char": "Q",
586
+ "width": 5,
587
+ "height": 26,
588
+ ],
589
+ [
590
+ "code_point": 82,
591
+ "char": "R",
592
+ "width": 5,
593
+ "height": 26,
594
+ ],
595
+ [
596
+ "code_point": 83,
597
+ "char": "S",
598
+ "width": 5,
599
+ "height": 26,
600
+ ],
601
+ [
602
+ "code_point": 84,
603
+ "char": "T",
604
+ "width": 5,
605
+ "height": 26,
606
+ ],
607
+ [
608
+ "code_point": 85,
609
+ "char": "U",
610
+ "width": 5,
611
+ "height": 26,
612
+ ],
613
+ [
614
+ "code_point": 86,
615
+ "char": "V",
616
+ "width": 6,
617
+ "height": 26,
618
+ ],
619
+ [
620
+ "code_point": 87,
621
+ "char": "W",
622
+ "width": 7,
623
+ "height": 26,
624
+ ],
625
+ [
626
+ "code_point": 88,
627
+ "char": "X",
628
+ "width": 6,
629
+ "height": 26,
630
+ ],
631
+ [
632
+ "code_point": 89,
633
+ "char": "Y",
634
+ "width": 6,
635
+ "height": 26,
636
+ ],
637
+ [
638
+ "code_point": 90,
639
+ "char": "Z",
640
+ "width": 5,
641
+ "height": 26,
642
+ ],
643
+ [
644
+ "code_point": 91,
645
+ "char": "[",
646
+ "width": 2,
647
+ "height": 26,
648
+ ],
649
+ [
650
+ "code_point": 92,
651
+ "char": "\\",
652
+ "width": 3,
653
+ "height": 26,
654
+ ],
655
+ [
656
+ "code_point": 93,
657
+ "char": "]",
658
+ "width": 2,
659
+ "height": 26,
660
+ ],
661
+ [
662
+ "code_point": 94,
663
+ "char": "^",
664
+ "width": 4,
665
+ "height": 26,
666
+ ],
667
+ [
668
+ "code_point": 95,
669
+ "char": "_",
670
+ "width": 3,
671
+ "height": 26,
672
+ ],
673
+ [
674
+ "code_point": 96,
675
+ "char": "`",
676
+ "width": 2,
677
+ "height": 26,
678
+ ],
679
+ [
680
+ "code_point": 97,
681
+ "char": "a",
682
+ "width": 5,
683
+ "height": 26,
684
+ ],
685
+ [
686
+ "code_point": 98,
687
+ "char": "b",
688
+ "width": 4,
689
+ "height": 26,
690
+ ],
691
+ [
692
+ "code_point": 99,
693
+ "char": "c",
694
+ "width": 4,
695
+ "height": 26,
696
+ ],
697
+ [
698
+ "code_point": 100,
699
+ "char": "d",
700
+ "width": 4,
701
+ "height": 26,
702
+ ],
703
+ [
704
+ "code_point": 101,
705
+ "char": "e",
706
+ "width": 4,
707
+ "height": 26,
708
+ ],
709
+ [
710
+ "code_point": 102,
711
+ "char": "f",
712
+ "width": 4,
713
+ "height": 26,
714
+ ],
715
+ [
716
+ "code_point": 103,
717
+ "char": "g",
718
+ "width": 4,
719
+ "height": 26,
720
+ ],
721
+ [
722
+ "code_point": 104,
723
+ "char": "h",
724
+ "width": 4,
725
+ "height": 26,
726
+ ],
727
+ [
728
+ "code_point": 105,
729
+ "char": "i",
730
+ "width": 1,
731
+ "height": 26,
732
+ ],
733
+ [
734
+ "code_point": 106,
735
+ "char": "j",
736
+ "width": 2,
737
+ "height": 26,
738
+ ],
739
+ [
740
+ "code_point": 107,
741
+ "char": "k",
742
+ "width": 4,
743
+ "height": 26,
744
+ ],
745
+ [
746
+ "code_point": 108,
747
+ "char": "l",
748
+ "width": 1,
749
+ "height": 26,
750
+ ],
751
+ [
752
+ "code_point": 109,
753
+ "char": "m",
754
+ "width": 7,
755
+ "height": 26,
756
+ ],
757
+ [
758
+ "code_point": 110,
759
+ "char": "n",
760
+ "width": 4,
761
+ "height": 26,
762
+ ],
763
+ [
764
+ "code_point": 111,
765
+ "char": "o",
766
+ "width": 4,
767
+ "height": 26,
768
+ ],
769
+ [
770
+ "code_point": 112,
771
+ "char": "p",
772
+ "width": 4,
773
+ "height": 26,
774
+ ],
775
+ [
776
+ "code_point": 113,
777
+ "char": "q",
778
+ "width": 4,
779
+ "height": 26,
780
+ ],
781
+ [
782
+ "code_point": 114,
783
+ "char": "r",
784
+ "width": 3,
785
+ "height": 26,
786
+ ],
787
+ [
788
+ "code_point": 115,
789
+ "char": "s",
790
+ "width": 4,
791
+ "height": 26,
792
+ ],
793
+ [
794
+ "code_point": 116,
795
+ "char": "t",
796
+ "width": 3,
797
+ "height": 26,
798
+ ],
799
+ [
800
+ "code_point": 117,
801
+ "char": "u",
802
+ "width": 5,
803
+ "height": 26,
804
+ ],
805
+ [
806
+ "code_point": 118,
807
+ "char": "v",
808
+ "width": 5,
809
+ "height": 26,
810
+ ],
811
+ [
812
+ "code_point": 119,
813
+ "char": "w",
814
+ "width": 7,
815
+ "height": 26,
816
+ ],
817
+ [
818
+ "code_point": 120,
819
+ "char": "x",
820
+ "width": 5,
821
+ "height": 26,
822
+ ],
823
+ [
824
+ "code_point": 121,
825
+ "char": "y",
826
+ "width": 5,
827
+ "height": 26,
828
+ ],
829
+ [
830
+ "code_point": 122,
831
+ "char": "z",
832
+ "width": 4,
833
+ "height": 26,
834
+ ],
835
+ [
836
+ "code_point": 123,
837
+ "char": "{",
838
+ "width": 3,
839
+ "height": 26,
840
+ ],
841
+ [
842
+ "code_point": 124,
843
+ "char": "|",
844
+ "width": 1,
845
+ "height": 26,
846
+ ],
847
+ [
848
+ "code_point": 125,
849
+ "char": "}",
850
+ "width": 3,
851
+ "height": 26,
852
+ ],
853
+ [
854
+ "code_point": 126,
855
+ "char": "~",
856
+ "width": 7,
857
+ "height": 26,
858
+ ],
859
+ [
860
+ "code_point": 192,
861
+ "char": "À",
862
+ "width": 6,
863
+ "height": 26,
864
+ ],
865
+ [
866
+ "code_point": 194,
867
+ "char": "Â",
868
+ "width": 6,
869
+ "height": 26,
870
+ ],
871
+ [
872
+ "code_point": 199,
873
+ "char": "Ç",
874
+ "width": 5,
875
+ "height": 26,
876
+ ],
877
+ [
878
+ "code_point": 200,
879
+ "char": "È",
880
+ "width": 4,
881
+ "height": 26,
882
+ ],
883
+ [
884
+ "code_point": 201,
885
+ "char": "É",
886
+ "width": 4,
887
+ "height": 26,
888
+ ],
889
+ [
890
+ "code_point": 202,
891
+ "char": "Ê",
892
+ "width": 4,
893
+ "height": 26,
894
+ ],
895
+ [
896
+ "code_point": 203,
897
+ "char": "Ë",
898
+ "width": 4,
899
+ "height": 26,
900
+ ],
901
+ [
902
+ "code_point": 206,
903
+ "char": "Î",
904
+ "width": 3,
905
+ "height": 26,
906
+ ],
907
+ [
908
+ "code_point": 207,
909
+ "char": "Ï",
910
+ "width": 3,
911
+ "height": 26,
912
+ ],
913
+ [
914
+ "code_point": 212,
915
+ "char": "Ô",
916
+ "width": 5,
917
+ "height": 26,
918
+ ],
919
+ [
920
+ "code_point": 217,
921
+ "char": "Ù",
922
+ "width": 5,
923
+ "height": 26,
924
+ ],
925
+ [
926
+ "code_point": 219,
927
+ "char": "Û",
928
+ "width": 5,
929
+ "height": 26,
930
+ ],
931
+ [
932
+ "code_point": 220,
933
+ "char": "Ü",
934
+ "width": 5,
935
+ "height": 26,
936
+ ],
937
+ [
938
+ "code_point": 224,
939
+ "char": "à",
940
+ "width": 5,
941
+ "height": 26,
942
+ ],
943
+ [
944
+ "code_point": 231,
945
+ "char": "ç",
946
+ "width": 4,
947
+ "height": 26,
948
+ ],
949
+ [
950
+ "code_point": 232,
951
+ "char": "è",
952
+ "width": 4,
953
+ "height": 26,
954
+ ],
955
+ [
956
+ "code_point": 233,
957
+ "char": "é",
958
+ "width": 4,
959
+ "height": 26,
960
+ ],
961
+ [
962
+ "code_point": 234,
963
+ "char": "ê",
964
+ "width": 4,
965
+ "height": 26,
966
+ ],
967
+ [
968
+ "code_point": 235,
969
+ "char": "ë",
970
+ "width": 4,
971
+ "height": 26,
972
+ ],
973
+ [
974
+ "code_point": 238,
975
+ "char": "î",
976
+ "width": 3,
977
+ "height": 26,
978
+ ],
979
+ [
980
+ "code_point": 239,
981
+ "char": "ï",
982
+ "width": 3,
983
+ "height": 26,
984
+ ],
985
+ [
986
+ "code_point": 244,
987
+ "char": "ô",
988
+ "width": 4,
989
+ "height": 26,
990
+ ],
991
+ [
992
+ "code_point": 249,
993
+ "char": "ù",
994
+ "width": 5,
995
+ "height": 26,
996
+ ],
997
+ [
998
+ "code_point": 251,
999
+ "char": "û",
1000
+ "width": 5,
1001
+ "height": 26,
1002
+ ],
1003
+ [
1004
+ "code_point": 252,
1005
+ "char": "ü",
1006
+ "width": 5,
1007
+ "height": 26,
1008
+ ],
1009
+ [
1010
+ "code_point": 255,
1011
+ "char": "ÿ",
1012
+ "width": 5,
1013
+ "height": 26,
1014
+ ],
1015
+ [
1016
+ "code_point": 376,
1017
+ "char": "Ÿ",
1018
+ "width": 6,
1019
+ "height": 26,
1020
+ ],
1021
+ [
1022
+ "code_point": 196,
1023
+ "char": "Ä",
1024
+ "width": 6,
1025
+ "height": 26,
1026
+ ],
1027
+ [
1028
+ "code_point": 228,
1029
+ "char": "ä",
1030
+ "width": 5,
1031
+ "height": 26,
1032
+ ],
1033
+ [
1034
+ "code_point": 214,
1035
+ "char": "Ö",
1036
+ "width": 5,
1037
+ "height": 26,
1038
+ ],
1039
+ [
1040
+ "code_point": 246,
1041
+ "char": "ö",
1042
+ "width": 4,
1043
+ "height": 26,
1044
+ ],
1045
+ [
1046
+ "code_point": 223,
1047
+ "char": "ß",
1048
+ "width": 4,
1049
+ "height": 26,
1050
+ ],
1051
+ [
1052
+ "code_point": 7838,
1053
+ "char": "ẞ",
1054
+ "width": 5,
1055
+ "height": 26,
1056
+ ],
1057
+ [
1058
+ "code_point": 226,
1059
+ "char": "â",
1060
+ "width": 5,
1061
+ "height": 26,
1062
+ ],
1063
+ [
1064
+ "code_point": 193,
1065
+ "char": "Á",
1066
+ "width": 6,
1067
+ "height": 26,
1068
+ ],
1069
+ [
1070
+ "code_point": 225,
1071
+ "char": "á",
1072
+ "width": 5,
1073
+ "height": 26,
1074
+ ],
1075
+ [
1076
+ "code_point": 205,
1077
+ "char": "Í",
1078
+ "width": 2,
1079
+ "height": 26,
1080
+ ],
1081
+ [
1082
+ "code_point": 237,
1083
+ "char": "í",
1084
+ "width": 2,
1085
+ "height": 26,
1086
+ ],
1087
+ [
1088
+ "code_point": 209,
1089
+ "char": "Ñ",
1090
+ "width": 5,
1091
+ "height": 26,
1092
+ ],
1093
+ [
1094
+ "code_point": 241,
1095
+ "char": "ñ",
1096
+ "width": 4,
1097
+ "height": 26,
1098
+ ],
1099
+ [
1100
+ "code_point": 250,
1101
+ "char": "ú",
1102
+ "width": 5,
1103
+ "height": 26,
1104
+ ],
1105
+ [
1106
+ "code_point": 211,
1107
+ "char": "Ó",
1108
+ "width": 5,
1109
+ "height": 26,
1110
+ ],
1111
+ [
1112
+ "code_point": 243,
1113
+ "char": "ó",
1114
+ "width": 4,
1115
+ "height": 26,
1116
+ ],
1117
+ [
1118
+ "code_point": 218,
1119
+ "char": "Ú",
1120
+ "width": 5,
1121
+ "height": 26,
1122
+ ],
1123
+ [
1124
+ "code_point": 46,
1125
+ "char": ".",
1126
+ "width": 1,
1127
+ "height": 26,
1128
+ ],
1129
+ [
1130
+ "code_point": 44,
1131
+ "char": ",",
1132
+ "width": 1,
1133
+ "height": 26,
1134
+ ],
1135
+ [
1136
+ "code_point": 58,
1137
+ "char": ":",
1138
+ "width": 1,
1139
+ "height": 26,
1140
+ ],
1141
+ [
1142
+ "code_point": 59,
1143
+ "char": ";",
1144
+ "width": 1,
1145
+ "height": 26,
1146
+ ],
1147
+ [
1148
+ "code_point": 8230,
1149
+ "char": "…",
1150
+ "width": 4,
1151
+ "height": 26,
1152
+ ],
1153
+ [
1154
+ "code_point": 33,
1155
+ "char": "!",
1156
+ "width": 1,
1157
+ "height": 26,
1158
+ ],
1159
+ [
1160
+ "code_point": 63,
1161
+ "char": "?",
1162
+ "width": 5,
1163
+ "height": 26,
1164
+ ],
1165
+ [
1166
+ "code_point": 183,
1167
+ "char": "·",
1168
+ "width": 1,
1169
+ "height": 26,
1170
+ ],
1171
+ [
1172
+ "code_point": 8226,
1173
+ "char": "•",
1174
+ "width": 3,
1175
+ "height": 26,
1176
+ ],
1177
+ [
1178
+ "code_point": 42,
1179
+ "char": "*",
1180
+ "width": 3,
1181
+ "height": 26,
1182
+ ],
1183
+ [
1184
+ "code_point": 35,
1185
+ "char": "#",
1186
+ "width": 6,
1187
+ "height": 26,
1188
+ ],
1189
+ [
1190
+ "code_point": 47,
1191
+ "char": "/",
1192
+ "width": 3,
1193
+ "height": 26,
1194
+ ],
1195
+ [
1196
+ "code_point": 92,
1197
+ "char": "\\",
1198
+ "width": 3,
1199
+ "height": 26,
1200
+ ],
1201
+ [
1202
+ "code_point": 45,
1203
+ "char": "-",
1204
+ "width": 4,
1205
+ "height": 26,
1206
+ ],
1207
+ [
1208
+ "code_point": 8211,
1209
+ "char": "–",
1210
+ "width": 6,
1211
+ "height": 26,
1212
+ ],
1213
+ [
1214
+ "code_point": 8212,
1215
+ "char": "—",
1216
+ "width": 6,
1217
+ "height": 26,
1218
+ ],
1219
+ [
1220
+ "code_point": 95,
1221
+ "char": "_",
1222
+ "width": 3,
1223
+ "height": 26,
1224
+ ],
1225
+ [
1226
+ "code_point": 40,
1227
+ "char": "(",
1228
+ "width": 2,
1229
+ "height": 26,
1230
+ ],
1231
+ [
1232
+ "code_point": 41,
1233
+ "char": ")",
1234
+ "width": 2,
1235
+ "height": 26,
1236
+ ],
1237
+ [
1238
+ "code_point": 123,
1239
+ "char": "{",
1240
+ "width": 3,
1241
+ "height": 26,
1242
+ ],
1243
+ [
1244
+ "code_point": 125,
1245
+ "char": "}",
1246
+ "width": 3,
1247
+ "height": 26,
1248
+ ],
1249
+ [
1250
+ "code_point": 91,
1251
+ "char": "[",
1252
+ "width": 2,
1253
+ "height": 26,
1254
+ ],
1255
+ [
1256
+ "code_point": 93,
1257
+ "char": "]",
1258
+ "width": 2,
1259
+ "height": 26,
1260
+ ],
1261
+ [
1262
+ "code_point": 8220,
1263
+ "char": "“",
1264
+ "width": 3,
1265
+ "height": 26,
1266
+ ],
1267
+ [
1268
+ "code_point": 8221,
1269
+ "char": "”",
1270
+ "width": 3,
1271
+ "height": 26,
1272
+ ],
1273
+ [
1274
+ "code_point": 8216,
1275
+ "char": "‘",
1276
+ "width": 1,
1277
+ "height": 26,
1278
+ ],
1279
+ [
1280
+ "code_point": 8217,
1281
+ "char": "’",
1282
+ "width": 1,
1283
+ "height": 26,
1284
+ ],
1285
+ [
1286
+ "code_point": 8249,
1287
+ "char": "‹",
1288
+ "width": 3,
1289
+ "height": 26,
1290
+ ],
1291
+ [
1292
+ "code_point": 8250,
1293
+ "char": "›",
1294
+ "width": 3,
1295
+ "height": 26,
1296
+ ],
1297
+ [
1298
+ "code_point": 34,
1299
+ "char": "\"",
1300
+ "width": 2,
1301
+ "height": 26,
1302
+ ],
1303
+ [
1304
+ "code_point": 39,
1305
+ "char": "'",
1306
+ "width": 1,
1307
+ "height": 26,
1308
+ ],
1309
+ [
1310
+ "code_point": 64,
1311
+ "char": "@",
1312
+ "width": 7,
1313
+ "height": 26,
1314
+ ],
1315
+ [
1316
+ "code_point": 38,
1317
+ "char": "&",
1318
+ "width": 7,
1319
+ "height": 26,
1320
+ ],
1321
+ [
1322
+ "code_point": 124,
1323
+ "char": "|",
1324
+ "width": 1,
1325
+ "height": 26,
1326
+ ],
1327
+ [
1328
+ "code_point": 43,
1329
+ "char": "+",
1330
+ "width": 4,
1331
+ "height": 26,
1332
+ ],
1333
+ [
1334
+ "code_point": 61,
1335
+ "char": "=",
1336
+ "width": 4,
1337
+ "height": 26,
1338
+ ],
1339
+ [
1340
+ "code_point": 62,
1341
+ "char": ">",
1342
+ "width": 4,
1343
+ "height": 26,
1344
+ ],
1345
+ [
1346
+ "code_point": 60,
1347
+ "char": "<",
1348
+ "width": 4,
1349
+ "height": 26,
1350
+ ],
1351
+ [
1352
+ "code_point": 126,
1353
+ "char": "~",
1354
+ "width": 7,
1355
+ "height": 26,
1356
+ ],
1357
+ [
1358
+ "code_point": 94,
1359
+ "char": "^",
1360
+ "width": 4,
1361
+ "height": 26,
1362
+ ],
1363
+ [
1364
+ "code_point": 37,
1365
+ "char": "%",
1366
+ "width": 6,
1367
+ "height": 26,
1368
+ ],
1369
+ [
1370
+ "code_point": 8260,
1371
+ "char": "⁄",
1372
+ "width": 4,
1373
+ "height": 26,
1374
+ ],
1375
+ [
1376
+ "code_point": 189,
1377
+ "char": "½",
1378
+ "width": 6,
1379
+ "height": 26,
1380
+ ],
1381
+ [
1382
+ "code_point": 188,
1383
+ "char": "¼",
1384
+ "width": 6,
1385
+ "height": 26,
1386
+ ],
1387
+ [
1388
+ "code_point": 190,
1389
+ "char": "¾",
1390
+ "width": 7,
1391
+ "height": 26,
1392
+ ],
1393
+ [
1394
+ "code_point": 8539,
1395
+ "char": "⅛",
1396
+ "width": 6,
1397
+ "height": 26,
1398
+ ],
1399
+ [
1400
+ "code_point": 8540,
1401
+ "char": "⅜",
1402
+ "width": 7,
1403
+ "height": 26,
1404
+ ],
1405
+ [
1406
+ "code_point": 8541,
1407
+ "char": "⅝",
1408
+ "width": 7,
1409
+ "height": 26,
1410
+ ],
1411
+ [
1412
+ "code_point": 8542,
1413
+ "char": "⅞",
1414
+ "width": 6,
1415
+ "height": 26,
1416
+ ],
1417
+ [
1418
+ "code_point": 8320,
1419
+ "char": "₀",
1420
+ "width": 3,
1421
+ "height": 26,
1422
+ ],
1423
+ [
1424
+ "code_point": 8321,
1425
+ "char": "₁",
1426
+ "width": 2,
1427
+ "height": 26,
1428
+ ],
1429
+ [
1430
+ "code_point": 8322,
1431
+ "char": "₂",
1432
+ "width": 3,
1433
+ "height": 26,
1434
+ ],
1435
+ [
1436
+ "code_point": 8323,
1437
+ "char": "₃",
1438
+ "width": 3,
1439
+ "height": 26,
1440
+ ],
1441
+ [
1442
+ "code_point": 8324,
1443
+ "char": "₄",
1444
+ "width": 3,
1445
+ "height": 26,
1446
+ ],
1447
+ [
1448
+ "code_point": 8325,
1449
+ "char": "₅",
1450
+ "width": 3,
1451
+ "height": 26,
1452
+ ],
1453
+ [
1454
+ "code_point": 8326,
1455
+ "char": "₆",
1456
+ "width": 3,
1457
+ "height": 26,
1458
+ ],
1459
+ [
1460
+ "code_point": 8327,
1461
+ "char": "₇",
1462
+ "width": 3,
1463
+ "height": 26,
1464
+ ],
1465
+ [
1466
+ "code_point": 8328,
1467
+ "char": "₈",
1468
+ "width": 3,
1469
+ "height": 26,
1470
+ ],
1471
+ [
1472
+ "code_point": 8329,
1473
+ "char": "₉",
1474
+ "width": 3,
1475
+ "height": 26,
1476
+ ],
1477
+ [
1478
+ "code_point": 8304,
1479
+ "char": "⁰",
1480
+ "width": 3,
1481
+ "height": 26,
1482
+ ],
1483
+ [
1484
+ "code_point": 8305,
1485
+ "char": "ⁱ",
1486
+ "width": 6,
1487
+ "height": 26,
1488
+ ],
1489
+ [
1490
+ "code_point": 8306,
1491
+ "char": "⁲",
1492
+ "width": 6,
1493
+ "height": 26,
1494
+ ],
1495
+ [
1496
+ "code_point": 8307,
1497
+ "char": "⁳",
1498
+ "width": 6,
1499
+ "height": 26,
1500
+ ],
1501
+ [
1502
+ "code_point": 8308,
1503
+ "char": "⁴",
1504
+ "width": 3,
1505
+ "height": 26,
1506
+ ],
1507
+ [
1508
+ "code_point": 8309,
1509
+ "char": "⁵",
1510
+ "width": 3,
1511
+ "height": 26,
1512
+ ],
1513
+ [
1514
+ "code_point": 8310,
1515
+ "char": "⁶",
1516
+ "width": 3,
1517
+ "height": 26,
1518
+ ],
1519
+ [
1520
+ "code_point": 8311,
1521
+ "char": "⁷",
1522
+ "width": 3,
1523
+ "height": 26,
1524
+ ],
1525
+ [
1526
+ "code_point": 8312,
1527
+ "char": "⁸",
1528
+ "width": 3,
1529
+ "height": 26,
1530
+ ],
1531
+ [
1532
+ "code_point": 8313,
1533
+ "char": "⁹",
1534
+ "width": 3,
1535
+ "height": 26,
1536
+ ],
1537
+ [
1538
+ "code_point": 191,
1539
+ "char": "¿",
1540
+ "width": 5,
1541
+ "height": 26,
1542
+ ],
1543
+ [
1544
+ "code_point": 8218,
1545
+ "char": "‚",
1546
+ "width": 1,
1547
+ "height": 26,
1548
+ ],
1549
+ [
1550
+ "code_point": 8222,
1551
+ "char": "„",
1552
+ "width": 3,
1553
+ "height": 26,
1554
+ ],
1555
+ [
1556
+ "code_point": 171,
1557
+ "char": "«",
1558
+ "width": 5,
1559
+ "height": 26,
1560
+ ],
1561
+ [
1562
+ "code_point": 187,
1563
+ "char": "»",
1564
+ "width": 5,
1565
+ "height": 26,
1566
+ ],
1567
+ [
1568
+ "code_point": 3647,
1569
+ "char": "฿",
1570
+ "width": 5,
1571
+ "height": 26,
1572
+ ],
1573
+ [
1574
+ "code_point": 182,
1575
+ "char": "¶",
1576
+ "width": 7,
1577
+ "height": 26,
1578
+ ],
1579
+ [
1580
+ "code_point": 167,
1581
+ "char": "§",
1582
+ "width": 5,
1583
+ "height": 26,
1584
+ ],
1585
+ [
1586
+ "code_point": 169,
1587
+ "char": "©",
1588
+ "width": 8,
1589
+ "height": 26,
1590
+ ],
1591
+ [
1592
+ "code_point": 174,
1593
+ "char": "®",
1594
+ "width": 5,
1595
+ "height": 26,
1596
+ ],
1597
+ [
1598
+ "code_point": 8482,
1599
+ "char": "™",
1600
+ "width": 6,
1601
+ "height": 26,
1602
+ ],
1603
+ [
1604
+ "code_point": 176,
1605
+ "char": "°",
1606
+ "width": 2,
1607
+ "height": 26,
1608
+ ],
1609
+ [
1610
+ "code_point": 166,
1611
+ "char": "¦",
1612
+ "width": 1,
1613
+ "height": 26,
1614
+ ],
1615
+ [
1616
+ "code_point": 8224,
1617
+ "char": "†",
1618
+ "width": 5,
1619
+ "height": 26,
1620
+ ],
1621
+ [
1622
+ "code_point": 8225,
1623
+ "char": "‡",
1624
+ "width": 5,
1625
+ "height": 26,
1626
+ ],
1627
+ [
1628
+ "code_point": 8364,
1629
+ "char": "€",
1630
+ "width": 7,
1631
+ "height": 26,
1632
+ ],
1633
+ [
1634
+ "code_point": 8383,
1635
+ "char": "₿",
1636
+ "width": 5,
1637
+ "height": 26,
1638
+ ],
1639
+ [
1640
+ "code_point": 162,
1641
+ "char": "¢",
1642
+ "width": 5,
1643
+ "height": 26,
1644
+ ],
1645
+ [
1646
+ "code_point": 36,
1647
+ "char": "$",
1648
+ "width": 5,
1649
+ "height": 26,
1650
+ ],
1651
+ [
1652
+ "code_point": 163,
1653
+ "char": "£",
1654
+ "width": 6,
1655
+ "height": 26,
1656
+ ],
1657
+ [
1658
+ "code_point": 165,
1659
+ "char": "¥",
1660
+ "width": 5,
1661
+ "height": 26,
1662
+ ],
1663
+ [
1664
+ "code_point": 8722,
1665
+ "char": "−",
1666
+ "width": 4,
1667
+ "height": 26,
1668
+ ],
1669
+ [
1670
+ "code_point": 215,
1671
+ "char": "×",
1672
+ "width": 4,
1673
+ "height": 26,
1674
+ ],
1675
+ [
1676
+ "code_point": 247,
1677
+ "char": "÷",
1678
+ "width": 4,
1679
+ "height": 26,
1680
+ ],
1681
+ [
1682
+ "code_point": 8800,
1683
+ "char": "≠",
1684
+ "width": 4,
1685
+ "height": 26,
1686
+ ],
1687
+ [
1688
+ "code_point": 8805,
1689
+ "char": "≥",
1690
+ "width": 4,
1691
+ "height": 26,
1692
+ ],
1693
+ [
1694
+ "code_point": 8804,
1695
+ "char": "≤",
1696
+ "width": 4,
1697
+ "height": 26,
1698
+ ],
1699
+ [
1700
+ "code_point": 177,
1701
+ "char": "±",
1702
+ "width": 4,
1703
+ "height": 26,
1704
+ ],
1705
+ [
1706
+ "code_point": 8776,
1707
+ "char": "≈",
1708
+ "width": 5,
1709
+ "height": 26,
1710
+ ],
1711
+ [
1712
+ "code_point": 172,
1713
+ "char": "¬",
1714
+ "width": 5,
1715
+ "height": 26,
1716
+ ],
1717
+ [
1718
+ "code_point": 8734,
1719
+ "char": "∞",
1720
+ "width": 8,
1721
+ "height": 26,
1722
+ ],
1723
+ [
1724
+ "code_point": 8747,
1725
+ "char": "∫",
1726
+ "width": 5,
1727
+ "height": 26,
1728
+ ],
1729
+ [
1730
+ "code_point": 8719,
1731
+ "char": "∏",
1732
+ "width": 5,
1733
+ "height": 26,
1734
+ ],
1735
+ [
1736
+ "code_point": 8721,
1737
+ "char": "∑",
1738
+ "width": 5,
1739
+ "height": 26,
1740
+ ],
1741
+ [
1742
+ "code_point": 8730,
1743
+ "char": "√",
1744
+ "width": 5,
1745
+ "height": 26,
1746
+ ],
1747
+ [
1748
+ "code_point": 8706,
1749
+ "char": "∂",
1750
+ "width": 5,
1751
+ "height": 26,
1752
+ ],
1753
+ [
1754
+ "code_point": 8240,
1755
+ "char": "‰",
1756
+ "width": 7,
1757
+ "height": 26,
1758
+ ],
1759
+ [
1760
+ "code_point": 8593,
1761
+ "char": "↑",
1762
+ "width": 6,
1763
+ "height": 26,
1764
+ ],
1765
+ [
1766
+ "code_point": 8599,
1767
+ "char": "↗",
1768
+ "width": 6,
1769
+ "height": 26,
1770
+ ],
1771
+ [
1772
+ "code_point": 8594,
1773
+ "char": "→",
1774
+ "width": 7,
1775
+ "height": 26,
1776
+ ],
1777
+ [
1778
+ "code_point": 8600,
1779
+ "char": "↘",
1780
+ "width": 6,
1781
+ "height": 26,
1782
+ ],
1783
+ [
1784
+ "code_point": 8595,
1785
+ "char": "↓",
1786
+ "width": 6,
1787
+ "height": 26,
1788
+ ],
1789
+ [
1790
+ "code_point": 8601,
1791
+ "char": "↙",
1792
+ "width": 6,
1793
+ "height": 26,
1794
+ ],
1795
+ [
1796
+ "code_point": 8592,
1797
+ "char": "←",
1798
+ "width": 7,
1799
+ "height": 26,
1800
+ ],
1801
+ [
1802
+ "code_point": 8598,
1803
+ "char": "↖",
1804
+ "width": 6,
1805
+ "height": 26,
1806
+ ],
1807
+ [
1808
+ "code_point": 8596,
1809
+ "char": "↔",
1810
+ "width": 8,
1811
+ "height": 26,
1812
+ ],
1813
+ [
1814
+ "code_point": 8597,
1815
+ "char": "↕",
1816
+ "width": 6,
1817
+ "height": 26,
1818
+ ],
1819
+ [
1820
+ "code_point": 9676,
1821
+ "char": "◌",
1822
+ "width": 9,
1823
+ "height": 26,
1824
+ ],
1825
+ [
1826
+ "code_point": 9674,
1827
+ "char": "◊",
1828
+ "width": 5,
1829
+ "height": 26,
1830
+ ],
1831
+ [
1832
+ "code_point": 168,
1833
+ "char": "¨",
1834
+ "width": 3,
1835
+ "height": 26,
1836
+ ],
1837
+ [
1838
+ "code_point": 729,
1839
+ "char": "˙",
1840
+ "width": 1,
1841
+ "height": 26,
1842
+ ],
1843
+ [
1844
+ "code_point": 96,
1845
+ "char": "`",
1846
+ "width": 2,
1847
+ "height": 26,
1848
+ ],
1849
+ [
1850
+ "code_point": 180,
1851
+ "char": "´",
1852
+ "width": 2,
1853
+ "height": 26,
1854
+ ],
1855
+ [
1856
+ "code_point": 733,
1857
+ "char": "˝",
1858
+ "width": 4,
1859
+ "height": 26,
1860
+ ],
1861
+ [
1862
+ "code_point": 710,
1863
+ "char": "ˆ",
1864
+ "width": 3,
1865
+ "height": 26,
1866
+ ],
1867
+ [
1868
+ "code_point": 711,
1869
+ "char": "ˇ",
1870
+ "width": 3,
1871
+ "height": 26,
1872
+ ],
1873
+ [
1874
+ "code_point": 728,
1875
+ "char": "˘",
1876
+ "width": 4,
1877
+ "height": 26,
1878
+ ],
1879
+ [
1880
+ "code_point": 730,
1881
+ "char": "˚",
1882
+ "width": 2,
1883
+ "height": 26,
1884
+ ],
1885
+ [
1886
+ "code_point": 732,
1887
+ "char": "˜",
1888
+ "width": 3,
1889
+ "height": 26,
1890
+ ],
1891
+ [
1892
+ "code_point": 175,
1893
+ "char": "¯",
1894
+ "width": 3,
1895
+ "height": 26,
1896
+ ],
1897
+ [
1898
+ "code_point": 184,
1899
+ "char": "¸",
1900
+ "width": 2,
1901
+ "height": 26,
1902
+ ],
1903
+ [
1904
+ "code_point": 731,
1905
+ "char": "˛",
1906
+ "width": 2,
1907
+ "height": 26,
1908
+ ],
1909
+ [
1910
+ "code_point": 306,
1911
+ "char": "IJ",
1912
+ "width": 4,
1913
+ "height": 26,
1914
+ ],
1915
+ [
1916
+ "code_point": 307,
1917
+ "char": "ij",
1918
+ "width": 2,
1919
+ "height": 26,
1920
+ ],
1921
+ [
1922
+ "code_point": 352,
1923
+ "char": "Š",
1924
+ "width": 5,
1925
+ "height": 26,
1926
+ ],
1927
+ [
1928
+ "code_point": 353,
1929
+ "char": "š",
1930
+ "width": 4,
1931
+ "height": 26,
1932
+ ],
1933
+ [
1934
+ "code_point": 381,
1935
+ "char": "Ž",
1936
+ "width": 5,
1937
+ "height": 26,
1938
+ ],
1939
+ [
1940
+ "code_point": 382,
1941
+ "char": "ž",
1942
+ "width": 4,
1943
+ "height": 26,
1944
+ ],
1945
+ [
1946
+ "code_point": 195,
1947
+ "char": "Ã",
1948
+ "width": 6,
1949
+ "height": 26,
1950
+ ],
1951
+ [
1952
+ "code_point": 197,
1953
+ "char": "Å",
1954
+ "width": 6,
1955
+ "height": 26,
1956
+ ],
1957
+ [
1958
+ "code_point": 198,
1959
+ "char": "Æ",
1960
+ "width": 8,
1961
+ "height": 26,
1962
+ ],
1963
+ [
1964
+ "code_point": 204,
1965
+ "char": "Ì",
1966
+ "width": 2,
1967
+ "height": 26,
1968
+ ],
1969
+ [
1970
+ "code_point": 208,
1971
+ "char": "Ð",
1972
+ "width": 5,
1973
+ "height": 26,
1974
+ ],
1975
+ [
1976
+ "code_point": 210,
1977
+ "char": "Ò",
1978
+ "width": 5,
1979
+ "height": 26,
1980
+ ],
1981
+ [
1982
+ "code_point": 213,
1983
+ "char": "Õ",
1984
+ "width": 5,
1985
+ "height": 26,
1986
+ ],
1987
+ [
1988
+ "code_point": 216,
1989
+ "char": "Ø",
1990
+ "width": 6,
1991
+ "height": 26,
1992
+ ],
1993
+ [
1994
+ "code_point": 221,
1995
+ "char": "Ý",
1996
+ "width": 6,
1997
+ "height": 26,
1998
+ ],
1999
+ [
2000
+ "code_point": 222,
2001
+ "char": "Þ",
2002
+ "width": 5,
2003
+ "height": 26,
2004
+ ],
2005
+ [
2006
+ "code_point": 227,
2007
+ "char": "ã",
2008
+ "width": 5,
2009
+ "height": 26,
2010
+ ],
2011
+ [
2012
+ "code_point": 229,
2013
+ "char": "å",
2014
+ "width": 5,
2015
+ "height": 26,
2016
+ ],
2017
+ [
2018
+ "code_point": 230,
2019
+ "char": "æ",
2020
+ "width": 8,
2021
+ "height": 26,
2022
+ ],
2023
+ [
2024
+ "code_point": 236,
2025
+ "char": "ì",
2026
+ "width": 2,
2027
+ "height": 26,
2028
+ ],
2029
+ [
2030
+ "code_point": 240,
2031
+ "char": "ð",
2032
+ "width": 5,
2033
+ "height": 26,
2034
+ ],
2035
+ [
2036
+ "code_point": 242,
2037
+ "char": "ò",
2038
+ "width": 4,
2039
+ "height": 26,
2040
+ ],
2041
+ [
2042
+ "code_point": 245,
2043
+ "char": "õ",
2044
+ "width": 4,
2045
+ "height": 26,
2046
+ ],
2047
+ [
2048
+ "code_point": 248,
2049
+ "char": "ø",
2050
+ "width": 5,
2051
+ "height": 26,
2052
+ ],
2053
+ [
2054
+ "code_point": 253,
2055
+ "char": "ý",
2056
+ "width": 5,
2057
+ "height": 26,
2058
+ ],
2059
+ [
2060
+ "code_point": 254,
2061
+ "char": "þ",
2062
+ "width": 4,
2063
+ "height": 26,
2064
+ ],
2065
+ ]
2066
+
2067
+ // Map characters directly to FontGlyph objects
2068
+ for glyph in hardcodedGlyphs {
2069
+ guard let codePoint = glyph["code_point"] as? Int,
2070
+ let width = glyph["width"] as? Int,
2071
+ let height = glyph["height"] as? Int
2072
+ else {
2073
+ continue
2074
+ }
2075
+
2076
+ let character = Character(UnicodeScalar(codePoint)!)
2077
+ fontMap[character] = FontGlyph(width: width, height: height)
2078
+ }
2079
+
2080
+ print("Hardcoded font data loaded successfully! \(fontMap.count) glyphs mapped.")
2081
+ }
2082
+
2083
+ func getGlyph(_ character: Character) -> FontGlyph {
2084
+ return fontMap[character] ?? FontGlyph(width: 6, height: 26) // Default width=6, height=26
2085
+ }
2086
+
2087
+ struct FontGlyph {
2088
+ let width: Int
2089
+ let height: Int
2090
+
2091
+ init(width: Int, height: Int) {
2092
+ self.width = width
2093
+ self.height = height
2094
+ }
2095
+ }
2096
+ }