diff options
| author | yum <yum.food.vr@gmail.com> | 2022-11-08 00:09:59 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2022-11-08 00:09:59 -0800 |
| commit | 2efc87a7180ec6e92127d22d1a3eb8c44fd392db (patch) | |
| tree | 0c8c6ace7d3b3752cdc67ee98bbb43a9ecec18cd | |
| parent | 77c6f366b2f81c60ed67e2fa6dc92df451e4229c (diff) | |
Update fonts
English, Japanese, Chinese, and Korean should look much better now.
French, German, and Spanish look like shit now, because I haven't
figured out how to best make Noto Sans stay within its bounding box.
* Use Noto Sans for most things
* Simplify how we enable unicode blocks & assign fonts to them
* Increase string matching window to 300. Works better in real-world
test.
66 files changed, 478 insertions, 41 deletions
diff --git a/Fonts/Noto_Sans_Korean/NotoSansKR-Black.otf b/Fonts/Noto_Sans_Korean/NotoSansKR-Black.otf Binary files differnew file mode 100644 index 0000000..5599581 --- /dev/null +++ b/Fonts/Noto_Sans_Korean/NotoSansKR-Black.otf diff --git a/Fonts/Noto_Sans_Korean/NotoSansKR-Bold.otf b/Fonts/Noto_Sans_Korean/NotoSansKR-Bold.otf Binary files differnew file mode 100644 index 0000000..be388bf --- /dev/null +++ b/Fonts/Noto_Sans_Korean/NotoSansKR-Bold.otf diff --git a/Fonts/Noto_Sans_Korean/NotoSansKR-Light.otf b/Fonts/Noto_Sans_Korean/NotoSansKR-Light.otf Binary files differnew file mode 100644 index 0000000..548e667 --- /dev/null +++ b/Fonts/Noto_Sans_Korean/NotoSansKR-Light.otf diff --git a/Fonts/Noto_Sans_Korean/NotoSansKR-Medium.otf b/Fonts/Noto_Sans_Korean/NotoSansKR-Medium.otf Binary files differnew file mode 100644 index 0000000..5ddbbc0 --- /dev/null +++ b/Fonts/Noto_Sans_Korean/NotoSansKR-Medium.otf diff --git a/Fonts/Noto_Sans_Korean/NotoSansKR-Regular.otf b/Fonts/Noto_Sans_Korean/NotoSansKR-Regular.otf Binary files differnew file mode 100644 index 0000000..7c5c2fa --- /dev/null +++ b/Fonts/Noto_Sans_Korean/NotoSansKR-Regular.otf diff --git a/Fonts/Noto_Sans_Korean/NotoSansKR-Thin.otf b/Fonts/Noto_Sans_Korean/NotoSansKR-Thin.otf Binary files differnew file mode 100644 index 0000000..1299fef --- /dev/null +++ b/Fonts/Noto_Sans_Korean/NotoSansKR-Thin.otf diff --git a/Fonts/Noto_Sans_Korean/OFL.txt b/Fonts/Noto_Sans_Korean/OFL.txt new file mode 100644 index 0000000..d4e7958 --- /dev/null +++ b/Fonts/Noto_Sans_Korean/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2012 Google Inc. All Rights Reserved.
+
+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.
diff --git a/Fonts/Noto_Sans_Mono/NotoSansMono-VariableFont_wdth,wght.ttf b/Fonts/Noto_Sans_Mono/NotoSansMono-VariableFont_wdth,wght.ttf Binary files differnew file mode 100644 index 0000000..bb1d627 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/NotoSansMono-VariableFont_wdth,wght.ttf diff --git a/Fonts/Noto_Sans_Mono/OFL.txt b/Fonts/Noto_Sans_Mono/OFL.txt new file mode 100644 index 0000000..d4e7958 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2012 Google Inc. All Rights Reserved.
+
+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.
diff --git a/Fonts/Noto_Sans_Mono/README.txt b/Fonts/Noto_Sans_Mono/README.txt new file mode 100644 index 0000000..93b2056 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/README.txt @@ -0,0 +1,99 @@ +Noto Sans Mono Variable Font +============================ + +This download contains Noto Sans Mono as both a variable font and static fonts. + +Noto Sans Mono is a variable font with these axes: + wdth + wght + +This means all the styles are contained in a single file: + NotoSansMono-VariableFont_wdth,wght.ttf + +If your app fully supports variable fonts, you can now pick intermediate styles +that aren’t available as static fonts. Not all apps support variable fonts, and +in those cases you can use the static font files for Noto Sans Mono: + static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Thin.ttf + static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-ExtraLight.ttf + static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Light.ttf + static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Regular.ttf + static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Medium.ttf + static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-SemiBold.ttf + static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Bold.ttf + static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-ExtraBold.ttf + static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Black.ttf + static/NotoSansMono_Condensed/NotoSansMono_Condensed-Thin.ttf + static/NotoSansMono_Condensed/NotoSansMono_Condensed-ExtraLight.ttf + static/NotoSansMono_Condensed/NotoSansMono_Condensed-Light.ttf + static/NotoSansMono_Condensed/NotoSansMono_Condensed-Regular.ttf + static/NotoSansMono_Condensed/NotoSansMono_Condensed-Medium.ttf + static/NotoSansMono_Condensed/NotoSansMono_Condensed-SemiBold.ttf + static/NotoSansMono_Condensed/NotoSansMono_Condensed-Bold.ttf + static/NotoSansMono_Condensed/NotoSansMono_Condensed-ExtraBold.ttf + static/NotoSansMono_Condensed/NotoSansMono_Condensed-Black.ttf + static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Thin.ttf + static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-ExtraLight.ttf + static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Light.ttf + static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Regular.ttf + static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Medium.ttf + static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-SemiBold.ttf + static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Bold.ttf + static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-ExtraBold.ttf + static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Black.ttf + static/NotoSansMono/NotoSansMono-Thin.ttf + static/NotoSansMono/NotoSansMono-ExtraLight.ttf + static/NotoSansMono/NotoSansMono-Light.ttf + static/NotoSansMono/NotoSansMono-Regular.ttf + static/NotoSansMono/NotoSansMono-Medium.ttf + static/NotoSansMono/NotoSansMono-SemiBold.ttf + static/NotoSansMono/NotoSansMono-Bold.ttf + static/NotoSansMono/NotoSansMono-ExtraBold.ttf + static/NotoSansMono/NotoSansMono-Black.ttf + +Get started +----------- + +1. Install the font files you want to use + +2. Use your app's font picker to view the font family and all the +available styles + +Learn more about variable fonts +------------------------------- + + https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts + https://variablefonts.typenetwork.com + https://medium.com/variable-fonts + +In desktop apps + + https://theblog.adobe.com/can-variable-fonts-illustrator-cc + https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts + +Online + + https://developers.google.com/fonts/docs/getting_started + https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide + https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts + +Installing fonts + + MacOS: https://support.apple.com/en-us/HT201749 + Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux + Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows + +Android Apps + + https://developers.google.com/fonts/docs/android + https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts + +License +------- +Please read the full license text (OFL.txt) to understand the permissions, +restrictions and requirements for usage, redistribution, and modification. + +You can use them in your products & projects – print or digital, +commercial or otherwise. + +This isn't legal advice, please consider consulting a lawyer and see the full +license for all details. diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Black.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Black.ttf Binary files differnew file mode 100644 index 0000000..5af77aa --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Black.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Bold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Bold.ttf Binary files differnew file mode 100644 index 0000000..f74b877 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Bold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-ExtraBold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-ExtraBold.ttf Binary files differnew file mode 100644 index 0000000..0c23287 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-ExtraBold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-ExtraLight.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-ExtraLight.ttf Binary files differnew file mode 100644 index 0000000..ced2b03 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-ExtraLight.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Light.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Light.ttf Binary files differnew file mode 100644 index 0000000..2846c3b --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Light.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Medium.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Medium.ttf Binary files differnew file mode 100644 index 0000000..f4b3823 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Medium.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Regular.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Regular.ttf Binary files differnew file mode 100644 index 0000000..9c8ee3c --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Regular.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-SemiBold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-SemiBold.ttf Binary files differnew file mode 100644 index 0000000..fe7b4ea --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-SemiBold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Thin.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Thin.ttf Binary files differnew file mode 100644 index 0000000..e17d87d --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono/NotoSansMono-Thin.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Black.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Black.ttf Binary files differnew file mode 100644 index 0000000..c920e76 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Black.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Bold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Bold.ttf Binary files differnew file mode 100644 index 0000000..7d08cc8 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Bold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-ExtraBold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-ExtraBold.ttf Binary files differnew file mode 100644 index 0000000..73966ba --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-ExtraBold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-ExtraLight.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-ExtraLight.ttf Binary files differnew file mode 100644 index 0000000..183266d --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-ExtraLight.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Light.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Light.ttf Binary files differnew file mode 100644 index 0000000..9345b27 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Light.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Medium.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Medium.ttf Binary files differnew file mode 100644 index 0000000..032cbb1 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Medium.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Regular.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Regular.ttf Binary files differnew file mode 100644 index 0000000..c1f3b52 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Regular.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-SemiBold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-SemiBold.ttf Binary files differnew file mode 100644 index 0000000..23e0283 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-SemiBold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Thin.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Thin.ttf Binary files differnew file mode 100644 index 0000000..435a4d9 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_Condensed/NotoSansMono_Condensed-Thin.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Black.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Black.ttf Binary files differnew file mode 100644 index 0000000..d45aa96 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Black.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Bold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Bold.ttf Binary files differnew file mode 100644 index 0000000..8efd388 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Bold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-ExtraBold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-ExtraBold.ttf Binary files differnew file mode 100644 index 0000000..c3bb76c --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-ExtraBold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-ExtraLight.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-ExtraLight.ttf Binary files differnew file mode 100644 index 0000000..f3ec294 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-ExtraLight.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Light.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Light.ttf Binary files differnew file mode 100644 index 0000000..172edbb --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Light.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Medium.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Medium.ttf Binary files differnew file mode 100644 index 0000000..573be69 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Medium.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Regular.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Regular.ttf Binary files differnew file mode 100644 index 0000000..e113920 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Regular.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-SemiBold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-SemiBold.ttf Binary files differnew file mode 100644 index 0000000..60c7b94 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-SemiBold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Thin.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Thin.ttf Binary files differnew file mode 100644 index 0000000..84ce2fb --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_ExtraCondensed/NotoSansMono_ExtraCondensed-Thin.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Black.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Black.ttf Binary files differnew file mode 100644 index 0000000..387145b --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Black.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Bold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Bold.ttf Binary files differnew file mode 100644 index 0000000..c93ed18 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Bold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-ExtraBold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-ExtraBold.ttf Binary files differnew file mode 100644 index 0000000..8162f99 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-ExtraBold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-ExtraLight.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-ExtraLight.ttf Binary files differnew file mode 100644 index 0000000..16ba008 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-ExtraLight.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Light.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Light.ttf Binary files differnew file mode 100644 index 0000000..20c941e --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Light.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Medium.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Medium.ttf Binary files differnew file mode 100644 index 0000000..796b5f6 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Medium.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Regular.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Regular.ttf Binary files differnew file mode 100644 index 0000000..d47a557 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Regular.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-SemiBold.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-SemiBold.ttf Binary files differnew file mode 100644 index 0000000..2feb57b --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-SemiBold.ttf diff --git a/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Thin.ttf b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Thin.ttf Binary files differnew file mode 100644 index 0000000..acbf136 --- /dev/null +++ b/Fonts/Noto_Sans_Mono/static/NotoSansMono_SemiCondensed/NotoSansMono_SemiCondensed-Thin.ttf diff --git a/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Black.otf b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Black.otf Binary files differnew file mode 100644 index 0000000..7529643 --- /dev/null +++ b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Black.otf diff --git a/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Bold.otf b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Bold.otf Binary files differnew file mode 100644 index 0000000..172eb67 --- /dev/null +++ b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Bold.otf diff --git a/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Light.otf b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Light.otf Binary files differnew file mode 100644 index 0000000..85ccdf4 --- /dev/null +++ b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Light.otf diff --git a/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Medium.otf b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Medium.otf Binary files differnew file mode 100644 index 0000000..0a5bd9e --- /dev/null +++ b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Medium.otf diff --git a/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Regular.otf b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Regular.otf Binary files differnew file mode 100644 index 0000000..d350ffa --- /dev/null +++ b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Regular.otf diff --git a/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Thin.otf b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Thin.otf Binary files differnew file mode 100644 index 0000000..0e98049 --- /dev/null +++ b/Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Thin.otf diff --git a/Fonts/Noto_Sans_Simplified_Chinese/OFL.txt b/Fonts/Noto_Sans_Simplified_Chinese/OFL.txt new file mode 100644 index 0000000..d4e7958 --- /dev/null +++ b/Fonts/Noto_Sans_Simplified_Chinese/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2012 Google Inc. All Rights Reserved.
+
+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.
diff --git a/unifont-15.0.01.ttf b/Fonts/unifont-15.0.01.ttf Binary files differindex bc3428d..bc3428d 100644 --- a/unifont-15.0.01.ttf +++ b/Fonts/unifont-15.0.01.ttf diff --git a/unifont-15.0.01.ttf.LICENSE b/Fonts/unifont-15.0.01.ttf.LICENSE index 94339e0..94339e0 100644 --- a/unifont-15.0.01.ttf.LICENSE +++ b/Fonts/unifont-15.0.01.ttf.LICENSE diff --git a/TaSTT.shader b/TaSTT.shader index d4f4faf..b722d63 100644 --- a/TaSTT.shader +++ b/TaSTT.shader @@ -807,7 +807,7 @@ float LETTER_COL = fmod(nth_letter, floor(LETTER_COLS));
float LETTER_ROW = floor(LETTER_ROWS) - floor(nth_letter / floor(LETTER_COLS));
- float LETTER_UV_ROW = (LETTER_ROW + CHAR_FRAC_ROW - 1.0) / LETTER_ROWS;
+ float LETTER_UV_ROW = (LETTER_ROW + CHAR_FRAC_ROW - 1.00) / LETTER_ROWS;
float LETTER_UV_COL = (LETTER_COL + CHAR_FRAC_COL) / LETTER_COLS;
float2 result;
Binary files differBinary files differBinary files differBinary files differBinary files differBinary files differBinary files differdiff --git a/generate.py b/generate.py index 2442dc7..92c2e25 100644 --- a/generate.py +++ b/generate.py @@ -16,10 +16,14 @@ state.encoding = osc_ctrl.generateEncoding() osc_ctrl.clear(client)
-i = 0x3400
+time.sleep(1)
+
+#i = 0xAC00
+#i = 0x3000
+i = 0x0000
line = ""
while True:
- for j in range(0, 256):
+ for j in range(0, 1024):
letter = chr(i)
line += letter
i = i + 1
diff --git a/generate_fonts.py b/generate_fonts.py index c21382d..3c3ffb0 100644 --- a/generate_fonts.py +++ b/generate_fonts.py @@ -6,62 +6,117 @@ import math # Use a power of 2 pixels per character so we can evenly divide the plane. font_pixels = 128 -font = ImageFont.truetype("unifont-15.0.01.ttf", font_pixels) -font_half_sz = ImageFont.truetype("unifont-15.0.01.ttf", int(font_pixels / 2)) +full_ratio = 0.75 +half_ratio = 0.5 +full_sz = int(font_pixels * full_ratio) +half_sz = int(font_pixels * half_ratio) +layout_engine = ImageFont.Layout.BASIC + +unifont = ImageFont.truetype("Fonts/unifont-15.0.01.ttf", full_sz, layout_engine=layout_engine) +unifont_half = ImageFont.truetype("Fonts/unifont-15.0.01.ttf", half_sz, layout_engine=layout_engine) + +noto_sans_mono = ImageFont.truetype("Fonts/Noto_Sans_Mono/NotoSansMono-VariableFont_wdth,wght.ttf", full_sz, layout_engine=layout_engine) + +noto_sans_sc_half = ImageFont.truetype("Fonts/Noto_Sans_Simplified_Chinese/NotoSansSC-Regular.otf", half_sz, layout_engine=layout_engine) + +noto_sans_kr_half = ImageFont.truetype("Fonts/Noto_Sans_Korean/NotoSansKR-Regular.otf", half_sz, layout_engine=layout_engine) n_rows = 64 n_cols = 128 -def allow_range(allowlist, lo, hi): - for i in range(lo, hi + 1): - allowlist.add(i) +class FontInfo: + def __init__(self, font, dy): + self.font = font + self.dy = dy + +def allow_range(allowlist, lo_hi, font = None, dy = 0): + for i in range(lo_hi[0], lo_hi[1] + 1): + allowlist[i] = FontInfo(font, dy) def ban_range(allowlist, lo, hi): for i in range(lo, hi + 1): - allowlist.remove(i) -allowlist = set() + del allowlist[i] +allowlist = {} # ASCII -allow_range(allowlist, 32, 126) +basic_latin = (32, 126) +allow_range(allowlist, basic_latin, font=noto_sans_mono, dy = -20) # Latin-1 supplement -allow_range(allowlist, 0x00A1, 255) +latin_1_supplement = (0x00A1, 0x00ff) +allow_range(allowlist, latin_1_supplement, font = noto_sans_mono) # Latin extended-A -allow_range(allowlist, 0x0100, 0x017F) +latin_extended_a = (0x0100, 0x017f) +allow_range(allowlist, latin_extended_a, font = noto_sans_mono) # Latin extended-B -allow_range(allowlist, 0x0180, 0x024F) +latin_extended_b = (0x0180, 0x024f) +allow_range(allowlist, latin_extended_b, font = noto_sans_mono) # Spacing modifier letters -allow_range(allowlist, 0x0250, 0x02AF) +ipa_extensions = (0x0250, 0x02af) +allow_range(allowlist, ipa_extensions, font = unifont) # Greek and Coptic -allow_range(allowlist, 880, 1023) +greek = (0x0370, 0x03ff) +allow_range(allowlist, greek, font = noto_sans_mono) ban_range(allowlist, 0x0378, 0x03a2) # Cyrillic -allow_range(allowlist, 0x0400, 0x04FF) +cyrillic = (0x0400, 0x04ff) +allow_range(allowlist, cyrillic, font = unifont) # Currency symbols -allow_range(allowlist, 0x20A0, 0x20C0) +currency_symbols = (0x20a0, 0x20c0) +allow_range(allowlist, currency_symbols, font = noto_sans_mono) -# Japanese -# Punctuation -allow_range(allowlist, 0x3000, 0x303F) -# Hiragana -allow_range(allowlist, 0x3041, 0x30FF) +# CJK +# +hangul_jamo = (0x1100, 0x11FF) +allow_range(allowlist, hangul_jamo, font = noto_sans_kr_half) +# +general_punctuation = (0x2000, 0x206f) +allow_range(allowlist, general_punctuation, font = noto_sans_mono) +# +kangxi_radicals = (0x2f00, 0x2fdf) +allow_range(allowlist, kangxi_radicals, font = noto_sans_sc_half) +# +cjk_symbols_and_punctuation = (0x3000, 0x303f) +allow_range(allowlist, cjk_symbols_and_punctuation, font = noto_sans_sc_half) +# +hiragana = (0x3041, 0x309f) +allow_range(allowlist, hiragana, font = noto_sans_sc_half) ban_range(allowlist, 0x3097, 0x3098) -# Katakana -allow_range(allowlist, 0x30A0, 0x30FF) -# CJK Unified Ideographs (Kanji) -allow_range(allowlist, 0x4E00, 0x9FFF) -# CJK Unified Ideographs extension A (rare Kanji) -allow_range(allowlist, 0x3400, 0x4dbf) +# +katakana = (0x30a0, 0x30ff) +allow_range(allowlist, katakana, font = noto_sans_sc_half) +# +hangul_compatibility_jamo = (0x3130, 0x318f) +allow_range(allowlist, hangul_compatibility_jamo, font = noto_sans_sc_half) +# +enclosed_cjk_letters_and_months = (0x3200, 0x32FF) +allow_range(allowlist, enclosed_cjk_letters_and_months, font = noto_sans_sc_half) +# +cjk_compatibility = (0x3300, 0x33ff) +allow_range(allowlist, cjk_compatibility, font = noto_sans_sc_half) +# +cjk_unified_extension_a = (0x3400, 0x4dbf) +allow_range(allowlist, cjk_unified_extension_a, font = noto_sans_sc_half) +# +cjk_ideographs = (0x4e00, 0x9fff) +allow_range(allowlist, cjk_ideographs, font = noto_sans_sc_half) +# +hangul_syllables = (0xAC00, 0xD7A3) +allow_range(allowlist, hangul_syllables, font = noto_sans_kr_half) +# +halfwidth_and_fullwidth = (0xff00, 0xffef) +allow_range(allowlist, halfwidth_and_fullwidth, font = noto_sans_sc_half) -# Korean -allow_range(allowlist, 0x1100, 0x11FF) -allow_range(allowlist, 0xAC00, 0xD7A3) +def in_range(x, range_pair) -> bool: + return x >= range_pair[0] and x <= range_pair[1] max_char = max(allowlist) +print("max char: {}".format(max_char)) +print("num chars: {}".format(len(allowlist))) total_rows = math.ceil(max_char / n_cols) print("total rows {}".format(total_rows)) total_textures = math.ceil(total_rows / n_rows) print("total textures {}".format(total_textures)) for nth_texture in range(0, total_textures): - # Create an 8K grayscale ("L") image + # Create an 8K grayscale ("L") or black and white ("1") image image = Image.new(mode="1", size=(8192,8192), color=0) draw = ImageDraw.Draw(image) @@ -73,18 +128,18 @@ for nth_texture in range(0, total_textures): # Generate the unicode character for this spot. n = row * n_cols + col char = None - if n in allowlist: + font_info = None + if n in allowlist.keys(): char = chr(n) + font_info = allowlist[n] else: char = " " + font_info = FontInfo(unifont, 0) # Hack: Chinese, Japanese, and Korean characters are all double # width and are all on textures [1,6]. To fit them in the same # grid, we use a half-size font. - if nth_texture == 0: - draw.text((col * font_pixels / 2, (row - row_begin) * font_pixels), char, font=font, fill=255) - else: - draw.text((col * font_pixels / 2, (row - row_begin) * font_pixels), char, - font=font_half_sz, fill=255) + draw.text((col * font_pixels / 2, (row - row_begin) * font_pixels + + font_info.dy), char, font=font_info.font, fill=255) image.save("font-%01d.png" % nth_texture) diff --git a/string_matcher.py b/string_matcher.py index 9060b26..f3284e9 100644 --- a/string_matcher.py +++ b/string_matcher.py @@ -66,7 +66,7 @@ def matchStrings(old_text: str, new_text: str, window_size = 3) -> str: # slice in the old and new transcriptions (O(N^2) time complexity). # This is still wildly inefficient, but good enough for continuous # transcription in a game bound by a single CPU core, like VRChat. - max_old_slices = 50 + max_old_slices = 300 old_n_slices = min(max_old_slices, len(old_text)) last_old_window = len(old_text) - window_size first_old_window = max(last_old_window - old_n_slices, 0) @@ -136,7 +136,7 @@ if __name__ == "__main__": good_out = "This repository contains the code for" assert(matchStrings(in1, in2) == good_out) - in1 = "a" * 10 * 1000 + in1 = "a" * 1000 in2 = "b" * 10 * 1000 # This should be fast (< 1 second) matchStrings(in1, in2) |
