diff --git a/assets/fonts/Inconsolata/Inconsolata-VariableFont_wdth,wght.ttf b/assets/fonts/Inconsolata/Inconsolata-VariableFont_wdth,wght.ttf new file mode 100644 index 0000000..2739432 Binary files /dev/null and b/assets/fonts/Inconsolata/Inconsolata-VariableFont_wdth,wght.ttf differ diff --git a/assets/fonts/Inconsolata/OFL.txt b/assets/fonts/Inconsolata/OFL.txt new file mode 100644 index 0000000..55533e1 --- /dev/null +++ b/assets/fonts/Inconsolata/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2006 The Inconsolata Project Authors + +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: +https://openfontlicense.org + + +----------------------------------------------------------- +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/assets/fonts/Inconsolata/README.txt b/assets/fonts/Inconsolata/README.txt new file mode 100644 index 0000000..e7b3728 --- /dev/null +++ b/assets/fonts/Inconsolata/README.txt @@ -0,0 +1,135 @@ +Inconsolata Variable Font +========================= + +This download contains Inconsolata as both a variable font and static fonts. + +Inconsolata is a variable font with these axes: + wdth + wght + +This means all the styles are contained in a single file: + Inconsolata-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 Inconsolata: + static/Inconsolata_UltraCondensed-ExtraLight.ttf + static/Inconsolata_UltraCondensed-Light.ttf + static/Inconsolata_UltraCondensed-Regular.ttf + static/Inconsolata_UltraCondensed-Medium.ttf + static/Inconsolata_UltraCondensed-SemiBold.ttf + static/Inconsolata_UltraCondensed-Bold.ttf + static/Inconsolata_UltraCondensed-ExtraBold.ttf + static/Inconsolata_UltraCondensed-Black.ttf + static/Inconsolata_ExtraCondensed-ExtraLight.ttf + static/Inconsolata_ExtraCondensed-Light.ttf + static/Inconsolata_ExtraCondensed-Regular.ttf + static/Inconsolata_ExtraCondensed-Medium.ttf + static/Inconsolata_ExtraCondensed-SemiBold.ttf + static/Inconsolata_ExtraCondensed-Bold.ttf + static/Inconsolata_ExtraCondensed-ExtraBold.ttf + static/Inconsolata_ExtraCondensed-Black.ttf + static/Inconsolata_Condensed-ExtraLight.ttf + static/Inconsolata_Condensed-Light.ttf + static/Inconsolata_Condensed-Regular.ttf + static/Inconsolata_Condensed-Medium.ttf + static/Inconsolata_Condensed-SemiBold.ttf + static/Inconsolata_Condensed-Bold.ttf + static/Inconsolata_Condensed-ExtraBold.ttf + static/Inconsolata_Condensed-Black.ttf + static/Inconsolata_SemiCondensed-ExtraLight.ttf + static/Inconsolata_SemiCondensed-Light.ttf + static/Inconsolata_SemiCondensed-Regular.ttf + static/Inconsolata_SemiCondensed-Medium.ttf + static/Inconsolata_SemiCondensed-SemiBold.ttf + static/Inconsolata_SemiCondensed-Bold.ttf + static/Inconsolata_SemiCondensed-ExtraBold.ttf + static/Inconsolata_SemiCondensed-Black.ttf + static/Inconsolata-ExtraLight.ttf + static/Inconsolata-Light.ttf + static/Inconsolata-Regular.ttf + static/Inconsolata-Medium.ttf + static/Inconsolata-SemiBold.ttf + static/Inconsolata-Bold.ttf + static/Inconsolata-ExtraBold.ttf + static/Inconsolata-Black.ttf + static/Inconsolata_SemiExpanded-ExtraLight.ttf + static/Inconsolata_SemiExpanded-Light.ttf + static/Inconsolata_SemiExpanded-Regular.ttf + static/Inconsolata_SemiExpanded-Medium.ttf + static/Inconsolata_SemiExpanded-SemiBold.ttf + static/Inconsolata_SemiExpanded-Bold.ttf + static/Inconsolata_SemiExpanded-ExtraBold.ttf + static/Inconsolata_SemiExpanded-Black.ttf + static/Inconsolata_Expanded-ExtraLight.ttf + static/Inconsolata_Expanded-Light.ttf + static/Inconsolata_Expanded-Regular.ttf + static/Inconsolata_Expanded-Medium.ttf + static/Inconsolata_Expanded-SemiBold.ttf + static/Inconsolata_Expanded-Bold.ttf + static/Inconsolata_Expanded-ExtraBold.ttf + static/Inconsolata_Expanded-Black.ttf + static/Inconsolata_ExtraExpanded-ExtraLight.ttf + static/Inconsolata_ExtraExpanded-Light.ttf + static/Inconsolata_ExtraExpanded-Regular.ttf + static/Inconsolata_ExtraExpanded-Medium.ttf + static/Inconsolata_ExtraExpanded-SemiBold.ttf + static/Inconsolata_ExtraExpanded-Bold.ttf + static/Inconsolata_ExtraExpanded-ExtraBold.ttf + static/Inconsolata_ExtraExpanded-Black.ttf + static/Inconsolata_UltraExpanded-ExtraLight.ttf + static/Inconsolata_UltraExpanded-Light.ttf + static/Inconsolata_UltraExpanded-Regular.ttf + static/Inconsolata_UltraExpanded-Medium.ttf + static/Inconsolata_UltraExpanded-SemiBold.ttf + static/Inconsolata_UltraExpanded-Bold.ttf + static/Inconsolata_UltraExpanded-ExtraBold.ttf + static/Inconsolata_UltraExpanded-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/assets/fonts/Inconsolata/static/Inconsolata-Black.ttf b/assets/fonts/Inconsolata/static/Inconsolata-Black.ttf new file mode 100644 index 0000000..cc192cf Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata-Black.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata-Bold.ttf b/assets/fonts/Inconsolata/static/Inconsolata-Bold.ttf new file mode 100644 index 0000000..0c1ee75 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata-Bold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata-ExtraBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata-ExtraBold.ttf new file mode 100644 index 0000000..38cf3ed Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata-ExtraBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata-ExtraLight.ttf b/assets/fonts/Inconsolata/static/Inconsolata-ExtraLight.ttf new file mode 100644 index 0000000..9806025 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata-ExtraLight.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata-Light.ttf b/assets/fonts/Inconsolata/static/Inconsolata-Light.ttf new file mode 100644 index 0000000..23b8cdd Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata-Light.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata-Medium.ttf b/assets/fonts/Inconsolata/static/Inconsolata-Medium.ttf new file mode 100644 index 0000000..258e6db Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata-Medium.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata-Regular.ttf b/assets/fonts/Inconsolata/static/Inconsolata-Regular.ttf new file mode 100644 index 0000000..ff1e6bb Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata-Regular.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata-SemiBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata-SemiBold.ttf new file mode 100644 index 0000000..623316a Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata-SemiBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Black.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Black.ttf new file mode 100644 index 0000000..3c2b167 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Black.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Bold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Bold.ttf new file mode 100644 index 0000000..ac3d27a Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Bold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Condensed-ExtraBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-ExtraBold.ttf new file mode 100644 index 0000000..a46e4fe Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-ExtraBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Condensed-ExtraLight.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-ExtraLight.ttf new file mode 100644 index 0000000..dffaa81 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-ExtraLight.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Light.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Light.ttf new file mode 100644 index 0000000..d690d04 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Light.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Medium.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Medium.ttf new file mode 100644 index 0000000..cac2ea1 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Medium.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Regular.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Regular.ttf new file mode 100644 index 0000000..9abda09 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-Regular.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Condensed-SemiBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-SemiBold.ttf new file mode 100644 index 0000000..f35b381 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Condensed-SemiBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Black.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Black.ttf new file mode 100644 index 0000000..4d3e5bd Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Black.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Bold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Bold.ttf new file mode 100644 index 0000000..361294d Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Bold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Expanded-ExtraBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-ExtraBold.ttf new file mode 100644 index 0000000..7f337a8 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-ExtraBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Expanded-ExtraLight.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-ExtraLight.ttf new file mode 100644 index 0000000..9744650 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-ExtraLight.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Light.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Light.ttf new file mode 100644 index 0000000..aa61777 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Light.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Medium.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Medium.ttf new file mode 100644 index 0000000..a8ac8bb Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Medium.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Regular.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Regular.ttf new file mode 100644 index 0000000..68c3132 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-Regular.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_Expanded-SemiBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-SemiBold.ttf new file mode 100644 index 0000000..6326903 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_Expanded-SemiBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Black.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Black.ttf new file mode 100644 index 0000000..9ee9235 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Black.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Bold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Bold.ttf new file mode 100644 index 0000000..3665f6f Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Bold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-ExtraBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-ExtraBold.ttf new file mode 100644 index 0000000..e4d6bf8 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-ExtraBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-ExtraLight.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-ExtraLight.ttf new file mode 100644 index 0000000..280f702 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-ExtraLight.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Light.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Light.ttf new file mode 100644 index 0000000..d351582 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Light.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Medium.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Medium.ttf new file mode 100644 index 0000000..dc8e484 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Medium.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Regular.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Regular.ttf new file mode 100644 index 0000000..6f7793c Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-Regular.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-SemiBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-SemiBold.ttf new file mode 100644 index 0000000..2ddb990 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraCondensed-SemiBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Black.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Black.ttf new file mode 100644 index 0000000..750e773 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Black.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Bold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Bold.ttf new file mode 100644 index 0000000..2ddada2 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Bold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-ExtraBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-ExtraBold.ttf new file mode 100644 index 0000000..1fc32dc Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-ExtraBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-ExtraLight.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-ExtraLight.ttf new file mode 100644 index 0000000..a3c8dbb Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-ExtraLight.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Light.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Light.ttf new file mode 100644 index 0000000..8f0f485 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Light.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Medium.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Medium.ttf new file mode 100644 index 0000000..760162b Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Medium.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Regular.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Regular.ttf new file mode 100644 index 0000000..897a96d Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-Regular.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-SemiBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-SemiBold.ttf new file mode 100644 index 0000000..599cb9a Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_ExtraExpanded-SemiBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Black.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Black.ttf new file mode 100644 index 0000000..234812d Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Black.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Bold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Bold.ttf new file mode 100644 index 0000000..7aae97d Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Bold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-ExtraBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-ExtraBold.ttf new file mode 100644 index 0000000..1355737 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-ExtraBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-ExtraLight.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-ExtraLight.ttf new file mode 100644 index 0000000..9e456e5 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-ExtraLight.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Light.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Light.ttf new file mode 100644 index 0000000..ab0dd5c Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Light.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Medium.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Medium.ttf new file mode 100644 index 0000000..45653e5 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Medium.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Regular.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Regular.ttf new file mode 100644 index 0000000..369c162 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-Regular.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-SemiBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-SemiBold.ttf new file mode 100644 index 0000000..17d8e2e Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiCondensed-SemiBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Black.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Black.ttf new file mode 100644 index 0000000..3e8f396 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Black.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Bold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Bold.ttf new file mode 100644 index 0000000..7e9e39a Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Bold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-ExtraBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-ExtraBold.ttf new file mode 100644 index 0000000..0233d1e Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-ExtraBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-ExtraLight.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-ExtraLight.ttf new file mode 100644 index 0000000..468f9b1 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-ExtraLight.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Light.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Light.ttf new file mode 100644 index 0000000..2b51044 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Light.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Medium.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Medium.ttf new file mode 100644 index 0000000..4a0ead1 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Medium.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Regular.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Regular.ttf new file mode 100644 index 0000000..ee0c1a4 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-Regular.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-SemiBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-SemiBold.ttf new file mode 100644 index 0000000..6036377 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_SemiExpanded-SemiBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Black.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Black.ttf new file mode 100644 index 0000000..5c9ed51 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Black.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Bold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Bold.ttf new file mode 100644 index 0000000..5196e97 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Bold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-ExtraBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-ExtraBold.ttf new file mode 100644 index 0000000..5496b52 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-ExtraBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-ExtraLight.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-ExtraLight.ttf new file mode 100644 index 0000000..69ab212 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-ExtraLight.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Light.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Light.ttf new file mode 100644 index 0000000..75e666d Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Light.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Medium.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Medium.ttf new file mode 100644 index 0000000..b75d6ab Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Medium.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Regular.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Regular.ttf new file mode 100644 index 0000000..8759a61 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-Regular.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-SemiBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-SemiBold.ttf new file mode 100644 index 0000000..3273499 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraCondensed-SemiBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Black.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Black.ttf new file mode 100644 index 0000000..2562ac5 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Black.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Bold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Bold.ttf new file mode 100644 index 0000000..67d6ec0 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Bold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-ExtraBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-ExtraBold.ttf new file mode 100644 index 0000000..1c59abb Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-ExtraBold.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-ExtraLight.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-ExtraLight.ttf new file mode 100644 index 0000000..3102f14 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-ExtraLight.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Light.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Light.ttf new file mode 100644 index 0000000..9b0fba1 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Light.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Medium.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Medium.ttf new file mode 100644 index 0000000..8198179 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Medium.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Regular.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Regular.ttf new file mode 100644 index 0000000..ed373d9 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-Regular.ttf differ diff --git a/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-SemiBold.ttf b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-SemiBold.ttf new file mode 100644 index 0000000..1c57bd3 Binary files /dev/null and b/assets/fonts/Inconsolata/static/Inconsolata_UltraExpanded-SemiBold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/NotoSansArabic-VariableFont_wdth,wght.ttf b/assets/fonts/Noto_Sans_Arabic/NotoSansArabic-VariableFont_wdth,wght.ttf new file mode 100644 index 0000000..85dd0ae Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/NotoSansArabic-VariableFont_wdth,wght.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/OFL.txt b/assets/fonts/Noto_Sans_Arabic/OFL.txt new file mode 100644 index 0000000..8dd72cd --- /dev/null +++ b/assets/fonts/Noto_Sans_Arabic/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2022 The Noto Project Authors (https://github.com/notofonts/arabic) + +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: +https://openfontlicense.org + + +----------------------------------------------------------- +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/assets/fonts/Noto_Sans_Arabic/README.txt b/assets/fonts/Noto_Sans_Arabic/README.txt new file mode 100644 index 0000000..3bc976e --- /dev/null +++ b/assets/fonts/Noto_Sans_Arabic/README.txt @@ -0,0 +1,99 @@ +Noto Sans Arabic Variable Font +============================== + +This download contains Noto Sans Arabic as both a variable font and static fonts. + +Noto Sans Arabic is a variable font with these axes: + wdth + wght + +This means all the styles are contained in a single file: + NotoSansArabic-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 Arabic: + static/NotoSansArabic_ExtraCondensed-Thin.ttf + static/NotoSansArabic_ExtraCondensed-ExtraLight.ttf + static/NotoSansArabic_ExtraCondensed-Light.ttf + static/NotoSansArabic_ExtraCondensed-Regular.ttf + static/NotoSansArabic_ExtraCondensed-Medium.ttf + static/NotoSansArabic_ExtraCondensed-SemiBold.ttf + static/NotoSansArabic_ExtraCondensed-Bold.ttf + static/NotoSansArabic_ExtraCondensed-ExtraBold.ttf + static/NotoSansArabic_ExtraCondensed-Black.ttf + static/NotoSansArabic_Condensed-Thin.ttf + static/NotoSansArabic_Condensed-ExtraLight.ttf + static/NotoSansArabic_Condensed-Light.ttf + static/NotoSansArabic_Condensed-Regular.ttf + static/NotoSansArabic_Condensed-Medium.ttf + static/NotoSansArabic_Condensed-SemiBold.ttf + static/NotoSansArabic_Condensed-Bold.ttf + static/NotoSansArabic_Condensed-ExtraBold.ttf + static/NotoSansArabic_Condensed-Black.ttf + static/NotoSansArabic_SemiCondensed-Thin.ttf + static/NotoSansArabic_SemiCondensed-ExtraLight.ttf + static/NotoSansArabic_SemiCondensed-Light.ttf + static/NotoSansArabic_SemiCondensed-Regular.ttf + static/NotoSansArabic_SemiCondensed-Medium.ttf + static/NotoSansArabic_SemiCondensed-SemiBold.ttf + static/NotoSansArabic_SemiCondensed-Bold.ttf + static/NotoSansArabic_SemiCondensed-ExtraBold.ttf + static/NotoSansArabic_SemiCondensed-Black.ttf + static/NotoSansArabic-Thin.ttf + static/NotoSansArabic-ExtraLight.ttf + static/NotoSansArabic-Light.ttf + static/NotoSansArabic-Regular.ttf + static/NotoSansArabic-Medium.ttf + static/NotoSansArabic-SemiBold.ttf + static/NotoSansArabic-Bold.ttf + static/NotoSansArabic-ExtraBold.ttf + static/NotoSansArabic-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/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Black.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Black.ttf new file mode 100644 index 0000000..bca658d Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Black.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Bold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Bold.ttf new file mode 100644 index 0000000..5e44da8 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Bold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-ExtraBold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-ExtraBold.ttf new file mode 100644 index 0000000..d680fe4 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-ExtraBold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-ExtraLight.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-ExtraLight.ttf new file mode 100644 index 0000000..c55e869 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-ExtraLight.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Light.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Light.ttf new file mode 100644 index 0000000..351eb18 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Light.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Medium.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Medium.ttf new file mode 100644 index 0000000..f05d484 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Medium.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Regular.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Regular.ttf new file mode 100644 index 0000000..3279938 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Regular.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-SemiBold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-SemiBold.ttf new file mode 100644 index 0000000..ea3d762 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-SemiBold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Thin.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Thin.ttf new file mode 100644 index 0000000..99cf26b Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Thin.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Black.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Black.ttf new file mode 100644 index 0000000..1eb4304 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Black.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Bold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Bold.ttf new file mode 100644 index 0000000..5004f7c Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Bold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-ExtraBold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-ExtraBold.ttf new file mode 100644 index 0000000..3026a99 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-ExtraBold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-ExtraLight.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-ExtraLight.ttf new file mode 100644 index 0000000..a202724 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-ExtraLight.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Light.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Light.ttf new file mode 100644 index 0000000..ad4b4f9 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Light.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Medium.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Medium.ttf new file mode 100644 index 0000000..09c78d0 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Medium.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Regular.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Regular.ttf new file mode 100644 index 0000000..1f1ddda Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Regular.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-SemiBold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-SemiBold.ttf new file mode 100644 index 0000000..35cd6c6 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-SemiBold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Thin.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Thin.ttf new file mode 100644 index 0000000..1a8ce7c Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_Condensed-Thin.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Black.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Black.ttf new file mode 100644 index 0000000..11c26c9 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Black.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Bold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Bold.ttf new file mode 100644 index 0000000..44440b0 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Bold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-ExtraBold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-ExtraBold.ttf new file mode 100644 index 0000000..2e4c549 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-ExtraBold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-ExtraLight.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-ExtraLight.ttf new file mode 100644 index 0000000..d90fe6c Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-ExtraLight.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Light.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Light.ttf new file mode 100644 index 0000000..9c48e3e Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Light.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Medium.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Medium.ttf new file mode 100644 index 0000000..496462a Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Medium.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Regular.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Regular.ttf new file mode 100644 index 0000000..bba51ab Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Regular.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-SemiBold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-SemiBold.ttf new file mode 100644 index 0000000..6a3e40f Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-SemiBold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Thin.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Thin.ttf new file mode 100644 index 0000000..ac5764a Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_ExtraCondensed-Thin.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Black.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Black.ttf new file mode 100644 index 0000000..52debaf Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Black.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Bold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Bold.ttf new file mode 100644 index 0000000..0fbef1f Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Bold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-ExtraBold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-ExtraBold.ttf new file mode 100644 index 0000000..d43aa09 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-ExtraBold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-ExtraLight.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-ExtraLight.ttf new file mode 100644 index 0000000..0fcf8ed Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-ExtraLight.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Light.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Light.ttf new file mode 100644 index 0000000..42a97c6 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Light.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Medium.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Medium.ttf new file mode 100644 index 0000000..3b38dee Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Medium.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Regular.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Regular.ttf new file mode 100644 index 0000000..594438a Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Regular.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-SemiBold.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-SemiBold.ttf new file mode 100644 index 0000000..059f978 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-SemiBold.ttf differ diff --git a/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Thin.ttf b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Thin.ttf new file mode 100644 index 0000000..c33d234 Binary files /dev/null and b/assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic_SemiCondensed-Thin.ttf differ diff --git a/assets/fonts/Noto_Sans_JP/NotoSansJP-VariableFont_wght.ttf b/assets/fonts/Noto_Sans_JP/NotoSansJP-VariableFont_wght.ttf new file mode 100644 index 0000000..6c730cd Binary files /dev/null and b/assets/fonts/Noto_Sans_JP/NotoSansJP-VariableFont_wght.ttf differ diff --git a/assets/fonts/Noto_Sans_JP/OFL.txt b/assets/fonts/Noto_Sans_JP/OFL.txt new file mode 100644 index 0000000..e660570 --- /dev/null +++ b/assets/fonts/Noto_Sans_JP/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source' + +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: +https://openfontlicense.org + + +----------------------------------------------------------- +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/assets/fonts/Noto_Sans_JP/README.txt b/assets/fonts/Noto_Sans_JP/README.txt new file mode 100644 index 0000000..5353e2e --- /dev/null +++ b/assets/fonts/Noto_Sans_JP/README.txt @@ -0,0 +1,71 @@ +Noto Sans JP Variable Font +========================== + +This download contains Noto Sans JP as both a variable font and static fonts. + +Noto Sans JP is a variable font with this axis: + wght + +This means all the styles are contained in a single file: + NotoSansJP-VariableFont_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 JP: + static/NotoSansJP-Thin.ttf + static/NotoSansJP-ExtraLight.ttf + static/NotoSansJP-Light.ttf + static/NotoSansJP-Regular.ttf + static/NotoSansJP-Medium.ttf + static/NotoSansJP-SemiBold.ttf + static/NotoSansJP-Bold.ttf + static/NotoSansJP-ExtraBold.ttf + static/NotoSansJP-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/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Black.ttf b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Black.ttf new file mode 100644 index 0000000..0e33dde Binary files /dev/null and b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Black.ttf differ diff --git a/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Bold.ttf b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Bold.ttf new file mode 100644 index 0000000..26a47bb Binary files /dev/null and b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Bold.ttf differ diff --git a/assets/fonts/Noto_Sans_JP/static/NotoSansJP-ExtraBold.ttf b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-ExtraBold.ttf new file mode 100644 index 0000000..8435967 Binary files /dev/null and b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-ExtraBold.ttf differ diff --git a/assets/fonts/Noto_Sans_JP/static/NotoSansJP-ExtraLight.ttf b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-ExtraLight.ttf new file mode 100644 index 0000000..df421ba Binary files /dev/null and b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-ExtraLight.ttf differ diff --git a/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Light.ttf b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Light.ttf new file mode 100644 index 0000000..7e8c292 Binary files /dev/null and b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Light.ttf differ diff --git a/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Medium.ttf b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Medium.ttf new file mode 100644 index 0000000..f107339 Binary files /dev/null and b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Medium.ttf differ diff --git a/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Regular.ttf b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Regular.ttf new file mode 100644 index 0000000..d13df30 Binary files /dev/null and b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Regular.ttf differ diff --git a/assets/fonts/Noto_Sans_JP/static/NotoSansJP-SemiBold.ttf b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-SemiBold.ttf new file mode 100644 index 0000000..2a24dc7 Binary files /dev/null and b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-SemiBold.ttf differ diff --git a/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Thin.ttf b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Thin.ttf new file mode 100644 index 0000000..b3d4cf4 Binary files /dev/null and b/assets/fonts/Noto_Sans_JP/static/NotoSansJP-Thin.ttf differ diff --git a/assets/text.frag b/assets/text.frag index 58383cf..a4289f7 100644 --- a/assets/text.frag +++ b/assets/text.frag @@ -68,5 +68,6 @@ void main() { // float x = fract(fragTexCoord.s); // float final = smoothstep(divider - 0.1, divider + 0.1, x); - finalColor = vec4(1, 1, 1, float_to_srgb(texelColor0.r)); //xelColor0;//vec4(1, 1, 0.0, 1.0); + finalColor = vec4(1, 1, 1, float_to_srgb(texelColor0.r)); //xelColor0; + // finalColor = vec4(1, 1, 0.0, 1.0); } diff --git a/build.zig b/build.zig index 759718e..af894df 100644 --- a/build.zig +++ b/build.zig @@ -130,24 +130,24 @@ pub fn build(b: *std.Build) void { client.root_module.addImport("bufzilla", bufzilla.module("bufzilla")); server.root_module.addImport("bufzilla", bufzilla.module("bufzilla")); - // const raylib_dep = b.dependency("raylib_zig", .{ - // .target = target, - // .optimize = optimize, - // }); + const raylib_dep = b.dependency("raylib_zig", .{ + .target = target, + .optimize = optimize, + }); - // const raylib = raylib_dep.module("raylib"); // main raylib module - // const raygui = raylib_dep.module("raygui"); // raygui module - // const raylib_artifact = raylib_dep.artifact("raylib"); // raylib C library - // raylib_artifact.root_module.addCMacro("SUPPORT_CUSTOM_FRAME_CONTROL", ""); + const raylib = raylib_dep.module("raylib"); // main raylib module + const raygui = raylib_dep.module("raygui"); // raygui module + const raylib_artifact = raylib_dep.artifact("raylib"); // raylib C library + raylib_artifact.root_module.addCMacro("SUPPORT_CUSTOM_FRAME_CONTROL", ""); - // client.linkLibrary(raylib_artifact); - // client.root_module.addImport("raylib", raylib); - // client.root_module.addImport("raygui", raygui); + client.linkLibrary(raylib_artifact); + client.root_module.addImport("raylib", raylib); + client.root_module.addImport("raygui", raygui); - const raylib_dep = b.dependency("raylib", .{ .target = target, .optimize = optimize }); - const raylib = raylib_dep.artifact("raylib"); - raylib.root_module.addCMacro("SUPPORT_CUSTOM_FRAME_CONTROL", ""); - client.linkLibrary(raylib); + // const raylib_dep = b.dependency("raylib", .{ .target = target, .optimize = optimize }); + // const raylib = raylib_dep.artifact("raylib"); + // raylib.root_module.addCMacro("SUPPORT_CUSTOM_FRAME_CONTROL", ""); + // client.linkLibrary(raylib); b.installArtifact(client); b.installArtifact(server); diff --git a/build.zig.zon b/build.zig.zon index d036770..6dbf504 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -56,10 +56,6 @@ .url = "git+https://github.com/hexops/freetype#972cd37bccecae2cc9f54cf0b562263a13209d02", .hash = "freetype-0.0.0-AAAAAA5JcwBMujojfNLEq5g_WijZtU56mRLYx8bjjiMU", }, - .raylib = .{ - .url = "git+https://github.com/raysan5/raylib#29896a24039fb687d6ede44c63a78dd3b5829f8b", - .hash = "raylib-5.6.0-dev-whq8uM8HDQU5L4MyTYQJ2jJv9oFfadsWbEmuUEmXiPkq", - }, }, .paths = .{ "build.zig", diff --git a/src/client/font.zig b/src/client/font.zig index 75ce75b..c5a8770 100644 --- a/src/client/font.zig +++ b/src/client/font.zig @@ -1,13 +1,11 @@ const std = @import("std"); -const c = @import("c.zig").c; -// const rl = @import("raylib"); +const rl = @import("raylib"); const kb = @import("kb"); const ft = @import("freetype"); const rp = @import("stb_rect_pack"); pub var ft_lib : ft.Library = undefined; -pub var shader : c.Shader = undefined; -// pub var shader : rl.Shader = undefined; +pub var shader : rl.Shader = undefined; const ATLAS_SIZE = 4096; @@ -20,47 +18,38 @@ const Glyph = struct { height : i32, dpi_width : f32, dpi_height : f32, - // rwidth : i16, - // rheight : i16, bearing_x : i32, bearing_y : i32, dpi_bearing_x : f32, dpi_bearing_y : f32, - // y_max : i16, - // y_min : i16, - descent : i32, ascent : i32, dpi_descent : f32, dpi_ascent : f32, - // advance : i16, - st0 : c.Vector2, - st1 : c.Vector2, - // st0 : rl.Vector2, - // st1 : rl.Vector2, + st0 : rl.Vector2, + st1 : rl.Vector2, }; pub const Font = struct { face : ft.Face, glyphs : std.AutoHashMap(u32, Glyph), kb : kb.kbts_font, - texture : c.Texture2D, - // texture : rl.Texture2D, + // texture : c.Texture2D, + texture : rl.Texture2D, + file_data : []u8, pub fn init(filename : []const u8, size : i32, allocator: std.mem.Allocator) !Font { - const font_data = try std.fs.cwd().readFileAlloc(allocator, filename, 10 * 1024 * 1024); + const file_data = try std.fs.cwd().readFileAlloc(allocator, filename, 10 * 1024 * 1024); + errdefer allocator.free(file_data); - var face = try ft_lib.createFaceMemory(font_data, 0); + var face = try ft_lib.createFaceMemory(file_data, 0); var glyphs = std.AutoHashMap(u32, Glyph).init(allocator); - try face.setCharSize(0, size * 64, 0, 96 * @as(u16, @intFromFloat(c.GetWindowScaleDPI().y))); - // try face.setPixelSizes(0, @intCast(size * @as(u16, @intFromFloat(c.GetWindowScaleDPI().y)))); - // try face.setCharSize(0, size * 64, 0, 72 * @as(u16, @intFromFloat(rl.getWindowScaleDPI().y))); - // try face.setCharSize(0, size * 64, 0, 0); + try face.setCharSize(0, size * 64, 0, 96 * @as(u16, @intFromFloat(rl.getWindowScaleDPI().y))); try face.selectCharmap(.unicode); var rects = try std.ArrayList(rp.stbrp_rect).initCapacity(allocator, 1024); @@ -75,21 +64,15 @@ pub const Font = struct { defer allocator.free(_atlas); @memset(_atlas, 0); - const atlas : c.Image = .{ - // const atlas : rl.Image = .{ + const atlas : rl.Image = .{ .data = _atlas.ptr, .width = ATLAS_SIZE, .height = ATLAS_SIZE, .mipmaps = 1, - .format = c.PIXELFORMAT_UNCOMPRESSED_GRAYSCALE, + .format = rl.PixelFormat.uncompressed_grayscale, }; - // var iter = face.iterateCharmap(); - // while (iter.next()) |char| { for (0..face.numGlyphs()) |index| { - // const i = iter.index; - - // for (0..face.numGlyphs()) |i| { try face.loadGlyph(@intCast(index), .{}); const bmp = face.glyph().bitmap(); @@ -130,31 +113,17 @@ pub const Font = struct { } } - // std.log.info("{}", .{bmp.width()}); const width : i32 = @intCast(bmp.width()); - // std.log.info("{}", .{bmp.rows()}); const height : i32 = @intCast(bmp.rows()); - // const dpi_width : i32 = @intFromFloat(@as(f32, @floatFromInt(width)) / rl.getWindowScaleDPI().x); - // const dpi_height : i32 = @intFromFloat(@as(f32, @floatFromInt(height)) / rl.getWindowScaleDPI().y); - // std.log.info("{}", .{@as(f32, @floatFromInt(width)) / c.GetWindowScaleDPI().x}); - const dpi_width : f32 = @as(f32, @floatFromInt(width)) / c.GetWindowScaleDPI().x; - // std.log.info("{}", .{@as(f32, @floatFromInt(height)) / c.GetWindowScaleDPI().y}); - const dpi_height : f32 = @as(f32, @floatFromInt(height)) / c.GetWindowScaleDPI().y; - // std.log.info("{}", .{face.glyph().bitmapLeft()}); + const dpi_width : f32 = @as(f32, @floatFromInt(width)) / rl.getWindowScaleDPI().x; + const dpi_height : f32 = @as(f32, @floatFromInt(height)) / rl.getWindowScaleDPI().y; const bearing_x : i32 = face.glyph().bitmapLeft(); - // std.log.info("{}", .{face.glyph().bitmapTop()}); const bearing_y : i32 = face.glyph().bitmapTop(); - // std.log.info("{}", .{@as(f32, @floatFromInt(bearing_x)) / c.GetWindowScaleDPI().x}); - const dpi_bearing_x : f32 = @as(f32, @floatFromInt(bearing_x)) / c.GetWindowScaleDPI().x; - // std.log.info("{}", .{@as(f32, @floatFromInt(bearing_y)) / c.GetWindowScaleDPI().y}); - const dpi_bearing_y : f32 = @as(f32, @floatFromInt(bearing_y)) / c.GetWindowScaleDPI().y; - // std.log.info("{}", .{height - bearing_y}); + const dpi_bearing_x : f32 = @as(f32, @floatFromInt(bearing_x)) / rl.getWindowScaleDPI().x; + const dpi_bearing_y : f32 = @as(f32, @floatFromInt(bearing_y)) / rl.getWindowScaleDPI().y; const descent : i32 = height - bearing_y; - // std.log.info("{}", .{height - descent}); const ascent : i32 = height - descent; - // std.log.info("{}", .{dpi_height - dpi_bearing_y}); const dpi_descent : f32 = dpi_height - dpi_bearing_y; - // std.log.info("{}", .{dpi_height - dpi_descent}); const dpi_ascent : f32 = dpi_height - dpi_descent; const x : i16 = @intCast(rect.x); @@ -178,13 +147,10 @@ pub const Font = struct { .height = height, .dpi_width = dpi_width, .dpi_height = dpi_height, - // .rwidth = @intCast(face.glyph().metrics().width >> 6), - // .rheight = @intCast(face.glyph().metrics().height >> 6), .descent = descent, .ascent = ascent, .dpi_descent = dpi_descent, .dpi_ascent = dpi_ascent, - // .advance = @intCast(face.glyph().advance().x >> 6), .st0 = .{.x = (fx + 0.5) / fs, .y = (fy - fh + 0.5) / fs}, .st1 = .{.x = (fx + fw - 0.5) / fs, .y = (fy - 0.5) / fs}, }; @@ -192,47 +158,38 @@ pub const Font = struct { try glyphs.put(glyph.index, glyph); } - const texture = c.LoadTextureFromImage(atlas); - // const texture = try rl.Texture.fromImage(atlas); + const texture = try rl.loadTextureFromImage(atlas); - var _kb = kb.kbts_FontFromMemory(font_data.ptr, @intCast(font_data.len), 0, null, null); + var _kb = kb.kbts_FontFromMemory(file_data.ptr, @intCast(file_data.len), 0, null, null); - if (kb.kbts_FontIsValid(&_kb) != 0) { + if (kb.kbts_FontIsValid(&_kb) == 0) { std.log.info("[Error] [kb_text_shape] Failed to load the font.", .{}); } - allocator.free(font_data); - return .{ .face = face, .glyphs = glyphs, .kb = _kb, .texture = texture, + .file_data = file_data, }; } - pub fn deinit(self: *Font) void { - // var it = self.glyphs.valueIterator(); - // while (it.next()) |g| { - // allocator.free(g.bitmap); - // } + pub fn deinit(self: *Font, allocator : std.mem.Allocator) void { self.glyphs.deinit(); self.face.deinit(); kb.kbts_FreeFont(&self.kb); - c.UnloadTexture(self.texture); - // self.texture.unload(); + self.texture.unload(); + allocator.free(self.file_data); } pub fn render_text( self: *Font, text: []const u8, - pos: c.Vector2, - // pos: rl.Vector2, + pos: rl.Vector2, window_space: bool, - colour: c.Color, - background: c.Color, - // colour: rl.Color, - // background: rl.Color, + colour: rl.Color, + background: rl.Color, nice_background: bool, count_descent: bool ) void { @@ -242,13 +199,10 @@ pub const Font = struct { if (nice_background) { self.render_text( text, - c.Vector2Add(pos, .{.x = 3.0, .y = -3.0}), - // pos.add(.{.x = 3.0, .y = -3.0}), + pos.add(.{.x = 3.0, .y = -3.0}), window_space, - c.Color{ .r = 0, .g = 0, .b = 0, .a = 255 }, - c.Color{ .r = 0, .g = 0, .b = 0, .a = 0 }, - // rl.Color.init(0, 0, 0, 255), - // rl.Color.init(0, 0, 0, 0), + rl.Color{ .r = 0, .g = 0, .b = 0, .a = 255 }, + rl.Color{ .r = 0, .g = 0, .b = 0, .a = 0 }, false, false ); @@ -256,19 +210,12 @@ pub const Font = struct { var render_pos = pos; _ = count_descent; - //_ = colour; _ = background; - // const draw_size, const max_ascent, const max_descent = self.size_row(text, 0, 0); - // _ = max_ascent; - // _ = max_descent; - const font_ascent = @as(f32, @floatFromInt(self.face.size().metrics().ascender >> 6)); - // const dpi_font_ascent = font_ascent / rl.getWindowScaleDPI().y; + const font_ascent : f32 = @floatFromInt(self.face.size().metrics().ascender >> 6); + const dpi_font_ascent = font_ascent / rl.getWindowScaleDPI().y; - render_pos.y += font_ascent; - - // c.DrawLine(@intFromFloat(render_pos.x), @intFromFloat(render_pos.y), c.GetScreenWidth(), @intFromFloat(render_pos.y), c.RED); - // rl.drawLine(@intFromFloat(render_pos.x), @intFromFloat(render_pos.y), rl.getScreenWidth(), @intFromFloat(render_pos.y), .red); + render_pos.y += dpi_font_ascent; const Context = kb.kbts_CreateShapeContext(null, null); const kb_font = kb.kbts_ShapePushFont(Context, &self.kb); @@ -277,21 +224,17 @@ pub const Font = struct { return; } - kb.kbts_ShapeBegin(Context, kb.KBTS_DIRECTION_DONT_KNOW, kb.KBTS_LANGUAGE_DONT_KNOW); + kb.kbts_ShapeBegin(Context, kb.KBTS_DIRECTION_DONT_KNOW, kb.KBTS_LANGUAGE_ENGLISH); kb.kbts_ShapeUtf8(Context, text.ptr, @intCast(text.len), kb.KBTS_USER_ID_GENERATION_MODE_CODEPOINT_INDEX); kb.kbts_ShapeEnd(Context); var x_offset : f32 = 0; var y_offset : f32 = 0; - c.BeginShaderMode(shader); - c.rlSetTexture(self.texture.id); - c.rlBegin(c.RL_QUADS); - // rl.beginShaderMode(shader); - // rl.gl.rlSetTexture(self.texture.id); - // rl.gl.rlBegin(rl.gl.rl_quads); + rl.beginShaderMode(shader); + rl.gl.rlSetTexture(self.texture.id); + rl.gl.rlBegin(rl.gl.rl_quads); - // Layout runs naively left to right. var Run = kb.kbts_run{}; while (kb.kbts_ShapeRun(Context, &Run) != 0) { if ((Run.Flags & kb.KBTS_BREAK_FLAG_LINE_HARD) != 0) { @@ -307,73 +250,38 @@ pub const Font = struct { std.log.info("aah it's wrong!! idk how to handle the error rn!!", .{}); } - const advance_x = @as(f32, @floatFromInt(ft.mulFix(RunGlyph.AdvanceX, @intCast(self.face.size().metrics().x_scale)) >> 6)); - const advance_y = @as(f32, @floatFromInt(ft.mulFix(RunGlyph.AdvanceY, @intCast(self.face.size().metrics().y_scale)) >> 6)); - const dpi_advance_x = advance_x / c.GetWindowScaleDPI().x; - const dpi_advance_y = advance_y / c.GetWindowScaleDPI().y; - // const dpi_advance_x = advance_x / rl.getWindowScaleDPI().x; - // const dpi_advance_y = advance_y / rl.getWindowScaleDPI().y; + const advance_x : f32 = @floatFromInt(ft.mulFix(RunGlyph.AdvanceX, @intCast(self.face.size().metrics().x_scale)) >> 6); + const advance_y : f32 = @floatFromInt(ft.mulFix(RunGlyph.AdvanceY, @intCast(self.face.size().metrics().y_scale)) >> 6); + const dpi_advance_x = advance_x / rl.getWindowScaleDPI().x; + const dpi_advance_y = advance_y / rl.getWindowScaleDPI().y; - // glyph : *Glyph = table_find_pointer(*text.font.glyphs, RunGlyph.Id); if (self.glyphs.getPtr(RunGlyph.Id)) |glyph| { - var v0 = c.Vector2{}; - var v1 = c.Vector2{}; + var v0 = rl.Vector2.zero(); + var v1 = rl.Vector2.zero(); // const bx = @as(f32, @floatFromInt(glyph.bearing_x)); const by = glyph.dpi_bearing_y; - // const height = @as(f32, @floatFromInt(glyph.height)); - // const descent = @as(f32, @floatFromInt(glyph.descent)); - // const ascent = @as(f32, @floatFromInt(glyph.ascent)); - // if (count_descent) { - v0 = c.Vector2Add(render_pos, .{ .x = x_offset,// + glyph.bearing_x, - .y = y_offset - by });// + draw_size.y });// /*- max_descent*/}; - // v0 = render_pos.add(.{ .x = x_offset,// + glyph.bearing_x, - // .y = y_offset - by });// + draw_size.y });// /*- max_descent*/}; - // } else { - // v0 = render_pos.add(.{ - // .x = x_offset,// + glyph.bearing_x, - // .y = y_offset - @as(f32, @floatFromInt(glyph.height - glyph.bearing_y)) - // });//* - glyph.height + draw_size.y*/}; - // } + + v0 = render_pos.add(.{ .x = x_offset + glyph.dpi_bearing_x, + .y = y_offset - by }); - v1 = c.Vector2Add(v0, c.Vector2{ .x = glyph.dpi_width, .y = glyph.dpi_height }); - // v1 = v0.add(rl.Vector2{ .x = @floatFromInt(glyph.width), .y = @floatFromInt(glyph.height) }); - const p0 : c.Vector4 = .{ .x = v0.x, .y = v0.y, .z = 0.0, .w = 1.0 }; - const p1 : c.Vector4 = .{ .x = v1.x, .y = v1.y, .z = 0.0, .w = 1.0 }; - // const p0 : rl.Vector4 = .{ .x = v0.x, .y = v0.y, .z = 0.0, .w = 1.0 }; - // const p1 : rl.Vector4 = .{ .x = v1.x, .y = v1.y, .z = 0.0, .w = 1.0 }; + v1 = v0.add(rl.Vector2{ .x = glyph.dpi_width, .y = glyph.dpi_height }); + const p0 : rl.Vector4 = .{ .x = v0.x, .y = v0.y, .z = 0.0, .w = 1.0 }; + const p1 : rl.Vector4 = .{ .x = v1.x, .y = v1.y, .z = 0.0, .w = 1.0 }; + x_offset += dpi_advance_x; y_offset += dpi_advance_y; - // #if Y_IS_UP { - // t0 := Vector2.{ - // cast(float, glyph.x) / cast(float, ATLAS_SIZE), - // cast(float, glyph.y) / cast(float, ATLAS_SIZE) - // }; - // t1 := t0 + Vector2.{ - // cast(float, glyph.width) / cast(float, ATLAS_SIZE), - // -cast(float, glyph.height) / cast(float, ATLAS_SIZE) - // }; - const st0 = glyph.st0; - const st1 = glyph.st1; - // } else { - // t0 := Vector2.{cast(float, glyph.x / ATLAS_SIZE), cast(float, glyph.y / ATLAS_SIZE)}; - // t1 := t0 + .{cast(float, glyph.width / ATLAS_SIZE), cast(float, glyph.height / ATLAS_SIZE)}; - // } + const st0 = glyph.st0; + const st1 = glyph.st1; - c.rlColor4ub(colour.r, colour.g, colour.b, colour.a); - c.rlNormal3f(0.0, 0.0, 1.0); + rl.gl.rlColor4ub(colour.r, colour.g, colour.b, colour.a); + rl.gl.rlNormal3f(0.0, 0.0, 1.0); - c.rlTexCoord2f(st0.x, st0.y); c.rlVertex2f(p0.x, p0.y); - c.rlTexCoord2f(st0.x, st1.y); c.rlVertex2f(p0.x, p1.y); - c.rlTexCoord2f(st1.x, st1.y); c.rlVertex2f(p1.x, p1.y); - c.rlTexCoord2f(st1.x, st0.y); c.rlVertex2f(p1.x, p0.y); - // rl.gl.rlColor4ub(colour.r, colour.g, colour.b, colour.a); - // rl.gl.rlNormal3f(0.0, 0.0, 1.0); + rl.gl.rlTexCoord2f(st0.x, st0.y); rl.gl.rlVertex2f(p0.x, p0.y); + rl.gl.rlTexCoord2f(st0.x, st1.y); rl.gl.rlVertex2f(p0.x, p1.y); + rl.gl.rlTexCoord2f(st1.x, st1.y); rl.gl.rlVertex2f(p1.x, p1.y); + rl.gl.rlTexCoord2f(st1.x, st0.y); rl.gl.rlVertex2f(p1.x, p0.y); - // rl.gl.rlTexCoord2f(st0.x, st0.y); rl.gl.rlVertex2f(p0.x, p0.y); - // rl.gl.rlTexCoord2f(st0.x, st1.y); rl.gl.rlVertex2f(p0.x, p1.y); - // rl.gl.rlTexCoord2f(st1.x, st1.y); rl.gl.rlVertex2f(p1.x, p1.y); - // rl.gl.rlTexCoord2f(st1.x, st0.y); rl.gl.rlVertex2f(p1.x, p0.y); } else { std.log.warn("kb_text_shape found the glyph, but we didn't load it from the font. index {}", .{RunGlyph.Id}); std.log.warn("advance_x {}", .{advance_x}); @@ -384,32 +292,28 @@ pub const Font = struct { } } - c.rlEnd(); - c.rlSetTexture(0); - c.EndShaderMode(); - // rl.gl.rlEnd(); - // rl.gl.rlSetTexture(0); - // rl.endShaderMode(); + rl.gl.rlEnd(); + rl.gl.rlSetTexture(0); + rl.endShaderMode(); } - pub fn size_row(self: *Font, str: []const u8, n: i32, max_width: f32) struct {c.Vector2, f32, i32} { + pub fn size_row(self: *Font, str: []const u8, n: i32, max_width: f32) struct {rl.Vector2, f32, i32} { _ = max_width; _ = n; const Context = kb.kbts_CreateShapeContext(null, null); const kb_font = kb.kbts_ShapePushFont(Context, &self.kb); if (kb_font == null) { std.log.info("Could not open font!", .{}); - return .{ c.Vector2.zero(), 0, 0 }; + return .{ rl.Vector2.zero(), 0, 0 }; } kb.kbts_ShapeBegin(Context, kb.KBTS_DIRECTION_DONT_KNOW, kb.KBTS_LANGUAGE_DONT_KNOW); kb.kbts_ShapeUtf8(Context, str.ptr, @intCast(str.len), kb.KBTS_USER_ID_GENERATION_MODE_CODEPOINT_INDEX); kb.kbts_ShapeEnd(Context); - var size = c.Vector2.zero(); + var size = rl.Vector2.zero(); var max_descent : f32 = 0; - // Layout runs naively left to right. var Run = kb.kbts_run{}; while(kb.kbts_ShapeRun(Context, &Run) != 0) { if ((Run.Flags & kb.KBTS_BREAK_FLAG_LINE_HARD) != 0) { @@ -418,7 +322,7 @@ pub const Font = struct { var g : [*c]kb.kbts_glyph = null; while (kb.kbts_GlyphIteratorNext(&Run.Glyphs, &g) != 0) { - const RunGlyph : *kb.kbts_glyph = g.?; // assert non-null + const RunGlyph : *kb.kbts_glyph = g.?; const CodepointIndex : i32 = RunGlyph.UserIdOrCodepointIndex; var ShapeCodepoint : kb.kbts_shape_codepoint = undefined; if (kb.kbts_ShapeGetShapeCodepoint(Context, CodepointIndex, &ShapeCodepoint) == 0) { @@ -426,10 +330,12 @@ pub const Font = struct { } if (self.glyphs.getPtr(@intCast(RunGlyph.Id))) |glyph| { - size.y = @max(size.y, @as(f32, @floatFromInt(glyph.dpi_height))); - // size.x += (ft.mulFix(RunGlyph.AdvanceX, self.face.size().metrics().x_scale) >> 6); - size.x += @floatFromInt(ft.mulFix(RunGlyph.AdvanceX, @intCast(self.face.size().metrics().x_scale)) >> 6); - max_descent = @max(max_descent, @as(f32, @floatFromInt(glyph.descent))); + const advance_x = @as(f32, @floatFromInt(ft.mulFix(RunGlyph.AdvanceX, @intCast(self.face.size().metrics().x_scale)) >> 6)); + const dpi_advance_x = advance_x / rl.getWindowScaleDPI().x; + + size.y = @max(size.y, glyph.dpi_height); + size.x += dpi_advance_x; + max_descent = @max(max_descent, glyph.dpi_descent); } } } diff --git a/src/client/main.zig b/src/client/main.zig index 3fcd281..5b6632b 100644 --- a/src/client/main.zig +++ b/src/client/main.zig @@ -1,12 +1,10 @@ const std = @import("std"); const zm = @import("zmath"); const znet = @import("znet"); -// const rl = @import("raylib"); +const rl = @import("raylib"); const bufzilla = @import("bufzilla"); const ft = @import("freetype"); -const c = @import("c.zig").c; - const shared = @import("shared"); const client = @import("client.zig"); @@ -40,26 +38,37 @@ pub fn main() !void { defer _ = dbg_allocator.deinit(); try znet.init(); defer znet.deinit(); - c.SetConfigFlags(c.FLAG_WINDOW_HIGHDPI); - // rl.setConfigFlags(.{ .window_highdpi = true }); - c.InitWindow(screen_width, screen_height, "zzz"); - // rl.initWindow(screen_width, screen_height, "zzz"); - defer c.CloseWindow(); - // defer rl.closeWindow(); + rl.setConfigFlags(.{ .window_highdpi = true }); + rl.initWindow(screen_width, screen_height, "zzz"); + defer rl.closeWindow(); font.ft_lib = try ft.Library.init(); - // std.log.debug("screen ? {}", .{rl.getScreenWidth()}); - // std.log.debug("screen ? {}", .{rl.getScreenHeight()}); - // std.log.debug("render ? {}", .{rl.getRenderWidth()}); - // std.log.debug("render ? {}", .{rl.getRenderHeight()}); + const sizes = [_]u32{ + 12, 13, 14, 15, 16, + 18, 20, 22, + }; - // std.log.debug("what's being used for viewport ? {}", .{rl.RLGL.State.framebufferWidth}); + var inconsolata: [sizes.len]font.Font = undefined; + var vollkorn: [sizes.len]font.Font = undefined; + var arabic: [sizes.len]font.Font = undefined; + var japanese: [sizes.len]font.Font = undefined; - var f = try font.Font.init("assets/fonts/Vollkorn/static/Vollkorn-Regular.ttf", 7, allocator); - defer f.deinit(); + for (sizes, 0..) |pt, i| { + inconsolata[i] = try font.Font.init("assets/fonts/Inconsolata/static/Inconsolata-Regular.ttf", @intCast(pt), allocator); + vollkorn[i] = try font.Font.init("assets/fonts/Vollkorn/static/Vollkorn-Regular.ttf", @intCast(pt), allocator); + arabic[i] = try font.Font.init("assets/fonts/Noto_Sans_Arabic/static/NotoSansArabic-Regular.ttf", @intCast(pt), allocator); + japanese[i] = try font.Font.init("assets/fonts/Noto_Sans_JP/static/NotoSansJP-Regular.ttf", @intCast(pt), allocator); + } - font.shader = c.LoadShader(null, "assets/text.frag"); + defer { + for (&inconsolata) |*f| f.deinit(allocator); + for (&vollkorn) |*f| f.deinit(allocator); + for (&arabic) |*f| f.deinit(allocator); + for (&japanese) |*f| f.deinit(allocator); + } + + font.shader = try rl.loadShader(null, "assets/text.frag"); // const test_shader1 = try c.LoadShader(null, "assets/test_1.frag"); // const test_shader2 = try c.LoadShader(null, "assets/test_2.frag"); @@ -133,12 +142,12 @@ pub fn main() !void { // rl.playMusicStream(music); // std.log.info("is music playing? {}", .{rl.isMusicStreamPlaying(music)}); - var old_time : f32 = @floatCast(c.GetTime()); + var old_time : f32 = @floatCast(rl.getTime()); // var old_time : f32 = @floatCast(rl.getTime()); - while (!c.WindowShouldClose()) { + while (!rl.windowShouldClose()) { // while (!rl.windowShouldClose()) { // Detect window close button or ESC key - const new_time : f32 = @floatCast(c.GetTime()); + const new_time : f32 = @floatCast(rl.getTime()); // const new_time : f32 = @floatCast(rl.getTime()); var frame_time = new_time - old_time; old_time = new_time; @@ -173,47 +182,94 @@ pub fn main() !void { }, }; - c.PollInputEvents(); - // rl.pollInputEvents(); + rl.pollInputEvents(); - // if (peer.state() == .connected) { - // const packet = try znet.Packet.init("Hello, Server!", 0, .reliable); - // try peer.send(packet); - // } - // // _ = peer; + // if (peer.state() == .connected) { + // const packet = try znet.Packet.init("Hello, Server!", 0, .reliable); + // try peer.send(packet); + // } + // // _ = peer; - // // Update - // //---------------------------------------------------------------------------------- - // // TODO: Update your variables here - // //---------------------------------------------------------------------------------- + // rl.updateMusicStream(music); - // rl.updateMusicStream(music); + while (accumulator > dt * k) { + // update(dt * cast(float) k); + accumulator -= dt * k; + gt += dt * k; + } - // while (accumulator > dt * k) { - // // update(dt * cast(float) k); - // accumulator -= dt * k; - // gt += dt * k; - // } + rl.beginDrawing(); + rl.clearBackground(.sky_blue); - // // Draw - // //---------------------------------------------------------------------------------- - c.BeginDrawing(); - c.ClearBackground(c.SKYBLUE); - // rl.clearBackground(.black); + var y : f32 = 0; - // rl.beginDrawing(); + for (&vollkorn) |*f| { + f.render_text( + "Whereas, disregard and contempt for human rights have resulted!fi", + rl.Vector2{ .x = 0, .y = y}, + true, + .white, + .blank, + false, + true + ); - // // rl.drawRectangle(screen_width - 100, 0, 100, 100, .red); + const font_ascent : f32 = @floatFromInt(f.face.size().metrics().ascender >> 6); + const dpi_font_ascent = font_ascent / rl.getWindowScaleDPI().y; - f.render_text( - "Whereas, disregard and contempt for human rights have resulted!fi", - c.Vector2{ .x = 0, .y = 0}, - true, - c.WHITE, - c.BLANK, - false, - true - ); + y += dpi_font_ascent; + } + + for (&inconsolata) |*f| { + f.render_text( + "Whereas, disregard and contempt for human rights have resulted!fi", + rl.Vector2{ .x = 0, .y = y}, + true, + .white, + .blank, + false, + true + ); + + const font_ascent : f32 = @floatFromInt(f.face.size().metrics().ascender >> 6); + const dpi_font_ascent = font_ascent / rl.getWindowScaleDPI().y; + + y += dpi_font_ascent; + } + + // for (&japanese) |*f| { + // f.render_text( + // "外は夜が長くて寒い", + // c.Vector2{ .x = 0, .y = y}, + // true, + // c.WHITE, + // c.BLANK, + // false, + // true + // ); + + // const font_ascent : f32 = @floatFromInt(f.face.size().metrics().ascender >> 6); + // const dpi_font_ascent = font_ascent / c.GetWindowScaleDPI().y; + + // y += dpi_font_ascent; + // } + + // for (&arabic) |*f| { + // f.render_text( + // "الليل طويل وبارد في الخارج", + // c.Vector2{ .x = 0, .y = y}, + // true, + // c.WHITE, + // c.BLANK, + // false, + // true + // ); + + // const font_ascent : f32 = @floatFromInt(f.face.size().metrics().ascender >> 6); + // const dpi_font_ascent = font_ascent / c.GetWindowScaleDPI().y; + + // y += dpi_font_ascent; + // } // f.render_text( // "Whereas, disregard and contempt for human rights have resulted!", // rl.Vector2.init(0, 0), @@ -224,107 +280,103 @@ pub fn main() !void { // true // ); - // // rl.beginShaderMode(test_shader1); - // // rl.gl.rlBegin(rl.gl.rl_quads); + // rl.beginShaderMode(test_shader1); + // rl.gl.rlBegin(rl.gl.rl_quads); - // // { - // // const topLeft : rl.Vector2 = .{ .x = 0.0, .y = 0.0 }; - // // const bottomRight : rl.Vector2 = .{ .x = @as(f32, @floatFromInt(rl.getScreenWidth())) / 2.0, .y = @as(f32, @floatFromInt(rl.getScreenHeight())) }; + // { + // const topLeft : rl.Vector2 = .{ .x = 0.0, .y = 0.0 }; + // const bottomRight : rl.Vector2 = .{ .x = @as(f32, @floatFromInt(rl.getScreenWidth())) / 2.0, .y = @as(f32, @floatFromInt(rl.getScreenHeight())) }; - // // rl.gl.rlVertex2f(topLeft.x, topLeft.y); - // // rl.gl.rlVertex2f(topLeft.x, bottomRight.y); - // // rl.gl.rlVertex2f(bottomRight.x, bottomRight.y); - // // rl.gl.rlVertex2f(bottomRight.x, topLeft.y); + // rl.gl.rlVertex2f(topLeft.x, topLeft.y); + // rl.gl.rlVertex2f(topLeft.x, bottomRight.y); + // rl.gl.rlVertex2f(bottomRight.x, bottomRight.y); + // rl.gl.rlVertex2f(bottomRight.x, topLeft.y); - // // } + // } - // // rl.gl.rlEnd(); - // // rl.endShaderMode(); + // rl.gl.rlEnd(); + // rl.endShaderMode(); - // // rl.beginShaderMode(test_shader2); - // // rl.gl.rlBegin(rl.gl.rl_quads); + // rl.beginShaderMode(test_shader2); + // rl.gl.rlBegin(rl.gl.rl_quads); - // // { - // // const topLeft : rl.Vector2 = .{ .x = @as(f32, @floatFromInt(rl.getScreenWidth())) / 2.0, .y = 0 }; - // // const bottomRight : rl.Vector2 = .{ .x = @floatFromInt(rl.getScreenWidth()), .y = @floatFromInt(rl.getScreenHeight()) }; + // { + // const topLeft : rl.Vector2 = .{ .x = @as(f32, @floatFromInt(rl.getScreenWidth())) / 2.0, .y = 0 }; + // const bottomRight : rl.Vector2 = .{ .x = @floatFromInt(rl.getScreenWidth()), .y = @floatFromInt(rl.getScreenHeight()) }; - // // rl.gl.rlVertex2f(topLeft.x, topLeft.y); - // // rl.gl.rlVertex2f(topLeft.x, bottomRight.y); - // // rl.gl.rlVertex2f(bottomRight.x, bottomRight.y); - // // rl.gl.rlVertex2f(bottomRight.x, topLeft.y); - // // } + // rl.gl.rlVertex2f(topLeft.x, topLeft.y); + // rl.gl.rlVertex2f(topLeft.x, bottomRight.y); + // rl.gl.rlVertex2f(bottomRight.x, bottomRight.y); + // rl.gl.rlVertex2f(bottomRight.x, topLeft.y); + // } - // // rl.gl.rlEnd(); - // // rl.endShaderMode(); + // rl.gl.rlEnd(); + // rl.endShaderMode(); - // // rl.beginShaderMode(test_shader2); - // // rl.gl.rlBegin(rl.gl.rl_quads); + // rl.beginShaderMode(test_shader2); + // rl.gl.rlBegin(rl.gl.rl_quads); - // // { - // // const topLeft : rl.Vector2 = .{ .x = @as(f32, @floatFromInt(rl.getScreenWidth())) / 2.0, .y = 0 }; - // // const bottomRight : rl.Vector2 = .{ .x = @floatFromInt(rl.getScreenWidth()), .y = @floatFromInt(rl.getScreenHeight()) }; + // { + // const topLeft : rl.Vector2 = .{ .x = @as(f32, @floatFromInt(rl.getScreenWidth())) / 2.0, .y = 0 }; + // const bottomRight : rl.Vector2 = .{ .x = @floatFromInt(rl.getScreenWidth()), .y = @floatFromInt(rl.getScreenHeight()) }; - // // rl.gl.rlVertex2f(topLeft.x, topLeft.y); - // // rl.gl.rlVertex2f(topLeft.x, bottomRight.y); - // // rl.gl.rlVertex2f(bottomRight.x, bottomRight.y); - // // rl.gl.rlVertex2f(bottomRight.x, topLeft.y); - // // } + // rl.gl.rlVertex2f(topLeft.x, topLeft.y); + // rl.gl.rlVertex2f(topLeft.x, bottomRight.y); + // rl.gl.rlVertex2f(bottomRight.x, bottomRight.y); + // rl.gl.rlVertex2f(bottomRight.x, topLeft.y); + // } - // // rl.gl.rlEnd(); - // // rl.endShaderMode(); + // rl.gl.rlEnd(); + // rl.endShaderMode(); - // // rl.drawRectangle(400, 0, 400, 450, rl.Color{ .r = 54, .g = 54, .b = 54, .a = 255 }); + // rl.drawRectangle(400, 0, 400, 450, rl.Color{ .r = 54, .g = 54, .b = 54, .a = 255 }); - // // f.texture.drawPro( - // // .{.x = 0, .y = 0, .width = 4096, .height = 4096}, - // // .{.x = 0, .y = 0, .width = 512, .height = 512 }, - // // .zero(), 0, .white); + // f.texture.drawPro( + // .{.x = 0, .y = 0, .width = 4096, .height = 4096}, + // .{.x = 0, .y = 0, .width = 512, .height = 512 }, + // .zero(), 0, .white); - // // const connected_text = "Connected"; - // //const not_connected_text = "Not Connected"; + // const connected_text = "Connected"; + //const not_connected_text = "Not Connected"; - // // switch (peer.state()) { - // // .connected => rl.drawText(connected_text, @divFloor(rl.getScreenWidth(), 2) - @divFloor(rl.measureText(connected_text, f.baseSize), 2), 50, 20, .white), - // // else => rl.drawText(not_connected_text, @divFloor(rl.getScreenWidth(), 2) - @divFloor(rl.measureText(not_connected_text, f.baseSize), 1), 50, 20, .white), - // // } - // //@divFloor(rl.getScreenWidth(), 2) - @divFloor(rl.measureText(connected_text, f.baseSize), 2), 50 + // switch (peer.state()) { + // .connected => rl.drawText(connected_text, @divFloor(rl.getScreenWidth(), 2) - @divFloor(rl.measureText(connected_text, f.baseSize), 2), 50, 20, .white), + // else => rl.drawText(not_connected_text, @divFloor(rl.getScreenWidth(), 2) - @divFloor(rl.measureText(not_connected_text, f.baseSize), 1), 50, 20, .white), + // } + //@divFloor(rl.getScreenWidth(), 2) - @divFloor(rl.measureText(connected_text, f.baseSize), 2), 50 - // // // const font_size : i32 = 180; - // // // const text_size = rl.Vector2{.x = @floatFromInt(rl.measureText(connected_text, font_size)), .y = font_size};//rl.measureTextEx(try rl.getFontDefault(), connected_text, font_size, font_size / 10); - // // // const pos = rl.Vector2{.x = 0, .y = 0}; - // // // rl.drawText(connected_text, pos.x, pos.y, font_size, .white); - // // // rl.drawRectangleLines(pos.x, pos.y, @intFromFloat(text_size.x), @intFromFloat(text_size.y), .red); - // // // rl.drawRectangle(pos.x, pos.y, rl.getScreenWidth(), rl.getScreenHeight(), .white); - // // rl.drawTexturePro(tx, - // // rl.Rectangle{.x = 0, .y = 0, .width = 32, .height = 32}, - // // rl.Rectangle{.x = 100, .y = 100, .width = 500, .height = 500}, - // // .{.x = 0, .y = 0}, - // // 0, - // // .white); + // const font_size : i32 = 180; + // const text_size = rl.Vector2{.x = @floatFromInt(rl.measureText(connected_text, font_size)), .y = font_size};//rl.measureTextEx(try rl.getFontDefault(), connected_text, font_size, font_size / 10); + // const pos = rl.Vector2{.x = 0, .y = 0}; + // rl.drawText(connected_text, pos.x, pos.y, font_size, .white); + // rl.drawRectangleLines(pos.x, pos.y, @intFromFloat(text_size.x), @intFromFloat(text_size.y), .red); + // rl.drawRectangle(pos.x, pos.y, rl.getScreenWidth(), rl.getScreenHeight(), .white); + // rl.drawTexturePro(tx, + // rl.Rectangle{.x = 0, .y = 0, .width = 32, .height = 32}, + // rl.Rectangle{.x = 100, .y = 100, .width = 500, .height = 500}, + // .{.x = 0, .y = 0}, + // 0, + // .white); - // //rl.drawLineV(.{.x = @floatFromInt(@divFloor(rl.getScreenWidth(), 2)), .y = 0}, .{.x = @floatFromInt(@divFloor(rl.getScreenWidth(), 2)), .y = @floatFromInt(rl.getScreenHeight())}, .red); + //rl.drawLineV(.{.x = @floatFromInt(@divFloor(rl.getScreenWidth(), 2)), .y = 0}, .{.x = @floatFromInt(@divFloor(rl.getScreenWidth(), 2)), .y = @floatFromInt(rl.getScreenHeight())}, .red); - // //rl.drawText("Congrats! You created your first window!", rl.getMouseX(), rl.getMouseY(), 20, .white); - // //rl.drawRectangleLines(0, 0, 100, 100, .red); - // // misc.drawFPS(0, 0, frame_time, frame); + //rl.drawText("Congrats! You created your first window!", rl.getMouseX(), rl.getMouseY(), 20, .white); + //rl.drawRectangleLines(0, 0, 100, 100, .red); + // misc.drawFPS(0, 0, frame_time, frame); - // //elf.draw(); + //elf.draw(); - // // rl.beginMode3D(camera); - // // rl.drawSphere(.{ .x = 0, .y = 0, .z = 0 }, 1, .red); - // // rl.endMode3D(); + // rl.beginMode3D(camera); + // rl.drawSphere(.{ .x = 0, .y = 0, .z = 0 }, 1, .red); + // rl.endMode3D(); - c.EndDrawing(); - // rl.endDrawing(); + rl.endDrawing(); - // //---------------------------------------------------------------------------------- - - c.SwapScreenBuffer(); - // rl.swapScreenBuffer(); + rl.swapScreenBuffer(); } } @@ -365,222 +417,3 @@ fn connect() !void { // }; // try std.testing.fuzz(Context{}, Context.testOne, .{}); // } - - - -// const c = @cImport({ -// @cInclude("raylib.h"); -// }); - -// //------------------------------------------------------------------------------------ -// // Program main entry point -// //------------------------------------------------------------------------------------ -// pub fn main() !void { -// // Initialization -// //-------------------------------------------------------------------------------------- -// const screenWidth = 800; -// const screenHeight = 450; - -// c.SetConfigFlags(c.FLAG_WINDOW_RESIZABLE | c.FLAG_WINDOW_HIGHDPI); -// c.InitWindow(screenWidth, screenHeight, "raylib [core] example - highdpi testbed"); - -// var scaleDpi = c.GetWindowScaleDPI(); -// var mousePos = c.GetMousePosition(); -// var currentMonitor = c.GetCurrentMonitor(); -// var windowPos = c.GetWindowPosition(); - -// const gridSpacing = 40; // Grid spacing in pixels - -// c.SetTargetFPS(60); -// //-------------------------------------------------------------------------------------- - -// // Main game loop -// while (!c.WindowShouldClose()) // Detect window close button or ESC key -// { -// // Update -// //---------------------------------------------------------------------------------- -// mousePos = c.GetMousePosition(); -// currentMonitor = c.GetCurrentMonitor(); -// scaleDpi = c.GetWindowScaleDPI(); -// windowPos = c.GetWindowPosition(); - -// if (c.IsKeyPressed(c.KEY_SPACE)) c.ToggleBorderlessWindowed(); -// if (c.IsKeyPressed(c.KEY_F)) c.ToggleFullscreen(); -// //---------------------------------------------------------------------------------- - -// // Draw -// //---------------------------------------------------------------------------------- -// c.BeginDrawing(); - -// c.ClearBackground(c.RAYWHITE); - -// // Draw grid -// const screen_h : usize = @intCast(c.GetScreenHeight()); -// const spacing : usize = @intCast(gridSpacing); - -// var limit = screen_h / spacing + 1; -// for (0..limit) |h| { -// const y : i32 = @intCast(h * gridSpacing); -// c.DrawText(c.TextFormat("%02i", y), 4, y - 4, 10, c.GRAY); -// c.DrawLine(24, y, c.GetScreenWidth(), y, c.LIGHTGRAY); -// } -// const screen_v : usize = @intCast(c.GetScreenWidth()); - -// limit = screen_v / spacing + 1; -// for (0..limit) |v| { -// const x : i32 = @intCast(v * gridSpacing); -// c.DrawText(c.TextFormat("%02i", x), x - 10, 4, 10, c.GRAY); -// c.DrawLine(x, 20, x, c.GetScreenHeight(), c.LIGHTGRAY); -// } - -// // Draw UI info -// c.DrawText(c.TextFormat("CURRENT MONITOR: %i/%i (%ix%i)", currentMonitor + 1, c.GetMonitorCount(), -// c.GetMonitorWidth(currentMonitor), c.GetMonitorHeight(currentMonitor)), 50, 50, 20, c.DARKGRAY); -// c.DrawText(c.TextFormat("WINDOW POSITION: %ix%i", windowPos.x, windowPos.y), 50, 90, 20, c.DARKGRAY); -// c.DrawText(c.TextFormat("SCREEN SIZE: %ix%i", c.GetScreenWidth(), c.GetScreenHeight()), 50, 130, 20, c.DARKGRAY); -// c.DrawText(c.TextFormat("RENDER SIZE: %ix%i", c.GetRenderWidth(), c.GetRenderHeight()), 50, 170, 20, c.DARKGRAY); -// c.DrawText(c.TextFormat("SCALE FACTOR: %.1fx%.1f", scaleDpi.x, scaleDpi.y), 50, 210, 20, c.GRAY); - -// // Draw reference rectangles, top-left and bottom-right corners -// c.DrawRectangle(0, 0, 30, 60, c.RED); -// c.DrawRectangle(c.GetScreenWidth() - 30, c.GetScreenHeight() - 60, 30, 60, c.BLUE); - -// // Draw mouse position -// c.DrawCircleV(c.GetMousePosition(), 20, c.MAROON); -// c.DrawRectangle(@intFromFloat(mousePos.x - 25), @intFromFloat(mousePos.y), 50, 2, c.BLACK); -// c.DrawRectangle(@intFromFloat(mousePos.x), @intFromFloat(mousePos.y - 25), 2, 50, c.BLACK); -// c.DrawText(c.TextFormat("[%i,%i]", c.GetMouseX(), c.GetMouseY()), @intFromFloat(mousePos.x - 44), -// if (mousePos.y > @as(f32, @floatFromInt(c.GetScreenHeight())) - 60) @intFromFloat(mousePos.y - 46) else @intFromFloat(mousePos.y + 30), 20, c.BLACK); - -// c.EndDrawing(); -// //---------------------------------------------------------------------------------- -// } - -// // De-Initialization -// //-------------------------------------------------------------------------------------- - -// // TODO: Unload all loaded resources at this point - -// c.CloseWindow(); // Close window and OpenGL context -// //-------------------------------------------------------------------------------------- - -// return; -// } - -// const c = @cImport({ -// @cInclude("raylib.h"); -// }); - -// //------------------------------------------------------------------------------------ -// // Program main entry point -// //------------------------------------------------------------------------------------ -// pub fn main() void { -// // Initialization -// //-------------------------------------------------------------------------------------- -// const screenWidth = 800; -// const screenHeight = 450; - -// c.SetConfigFlags(c.FLAG_WINDOW_HIGHDPI | c.FLAG_WINDOW_RESIZABLE); -// c.InitWindow(screenWidth, screenHeight, "raylib [core] example - highdpi demo"); -// c.SetWindowMinSize(450, 450); - -// const logicalGridDescY = 120; -// const logicalGridLabelY = logicalGridDescY + 30; -// const logicalGridTop = logicalGridLabelY + 30; -// const logicalGridBottom = logicalGridTop + 80; -// const pixelGridTop = logicalGridBottom - 20; -// const pixelGridBottom = pixelGridTop + 80; -// const pixelGridLabelY = pixelGridBottom + 30; -// const pixelGridDescY = pixelGridLabelY + 30; -// const cellSize = 50; -// var cellSizePx : f32 = @floatFromInt(cellSize); - -// c.SetTargetFPS(60); // Set our game to run at 60 frames-per-second -// //-------------------------------------------------------------------------------------- - -// // Main game loop -// while (!c.WindowShouldClose()) // Detect window close button or ESC key -// { -// // Update -// //---------------------------------------------------------------------------------- -// const monitorCount = c.GetMonitorCount(); - -// if ((monitorCount > 1) and c.IsKeyPressed(c.KEY_N)) { -// c.SetWindowMonitor(@mod((c.GetCurrentMonitor() + 1), monitorCount)); -// } - -// const currentMonitor = c.GetCurrentMonitor(); -// const dpiScale = c.GetWindowScaleDPI(); -// cellSizePx = (@as(f32, @floatFromInt(cellSize)))/dpiScale.x; -// //---------------------------------------------------------------------------------- - -// // Draw -// //---------------------------------------------------------------------------------- -// c.BeginDrawing(); - -// c.ClearBackground(c.RAYWHITE); - -// const windowCenter = @divFloor(c.GetScreenWidth(), 2); -// DrawTextCenter(c.TextFormat("Dpi Scale: %f", dpiScale.x), windowCenter, 30, 40, c.DARKGRAY); -// DrawTextCenter(c.TextFormat("Monitor: %d/%d ([N] next monitor)", currentMonitor+1, monitorCount), windowCenter, 70, 20, c.LIGHTGRAY); -// DrawTextCenter(c.TextFormat("Window is %d \"logical points\" wide", c.GetScreenWidth()), windowCenter, logicalGridDescY, 20, c.ORANGE); - -// var odd = true; -// var i : i32 = cellSize; -// while (i < c.GetScreenWidth()) { -// // for (int i = cellSize; i < GetScreenWidth(); i += cellSize, odd = !odd) { -// if (odd) c.DrawRectangle(i, logicalGridTop, cellSize, logicalGridBottom-logicalGridTop, c.ORANGE); - -// DrawTextCenter(c.TextFormat("%d", i), i, logicalGridLabelY, 10, c.LIGHTGRAY); -// c.DrawLine(i, logicalGridLabelY + 10, i, logicalGridBottom, c.GRAY); - -// i += cellSize; -// odd = !odd; -// } - -// odd = true; -// const minTextSpace = 30; -// var lastTextX : i32 = -minTextSpace; -// i = cellSize; -// while (i < c.GetRenderWidth()) { -// // for (int i = cellSize; i < GetRenderWidth(); i += cellSize, odd = !odd) { -// const x : i32 = @intFromFloat(@as(f32, @floatFromInt(i)) / dpiScale.x); -// if (odd) c.DrawRectangle(x, pixelGridTop, @intFromFloat(cellSizePx), pixelGridBottom - pixelGridTop, c.Color{ .r = 0, .g = 121, .b = 241, .a = 100 }); - -// c.DrawLine(x, pixelGridTop, @intFromFloat(@as(f32, @floatFromInt(i)) / dpiScale.x), pixelGridLabelY - 10, c.GRAY); - -// if ((x - lastTextX) >= minTextSpace) -// { -// DrawTextCenter(c.TextFormat("%d", i), x, pixelGridLabelY, 10, c.LIGHTGRAY); -// lastTextX = x; -// } -// i += cellSize; -// odd = !odd; -// } - -// DrawTextCenter(c.TextFormat("Window is %d \"physical pixels\" wide", c.GetRenderWidth()), windowCenter, pixelGridDescY, 20, c.BLUE); - -// const text = "Can you see this?"; -// const size = c.MeasureTextEx(c.GetFontDefault(), text, 20, 3); -// const pos = c.Vector2{ .x = @as(f32, @floatFromInt(c.GetScreenWidth())) - size.x - 5, .y = @as(f32, @floatFromInt(c.GetScreenHeight())) - size.y - 5 }; -// c.DrawTextEx(c.GetFontDefault(), text, pos, 20, 3, c.LIGHTGRAY); - -// c.EndDrawing(); -// //---------------------------------------------------------------------------------- -// } - -// // De-Initialization -// //-------------------------------------------------------------------------------------- -// c.CloseWindow(); // Close window and OpenGL context -// //-------------------------------------------------------------------------------------- -// } - -// //------------------------------------------------------------------------------------ -// // Module Functions Definition -// //------------------------------------------------------------------------------------ -// fn DrawTextCenter(text : [*:0]const u8, x : i32, y: i32, fontSize : i32, color: c.Color) void { -// // fn DrawTextCenter(const char *text, int x, int y, int fontSize, Color color) void { -// const size = c.MeasureTextEx(c.GetFontDefault(), text, @floatFromInt(fontSize), 3); -// const pos = c.Vector2{ .x = @as(f32, @floatFromInt(x)) - size.x/2, .y = @as(f32, @floatFromInt(y)) - size.y/2 }; -// c.DrawTextEx(c.GetFontDefault(), text, pos, @as(f32, @floatFromInt(fontSize)), 3, color); -// } diff --git a/src/client/misc.zig b/src/client/misc.zig index c4f78f3..1643f5b 100644 --- a/src/client/misc.zig +++ b/src/client/misc.zig @@ -1,4 +1,5 @@ -const rl = @import("raylib"); +const c = @import("c.zig").c; +// const rl = @import("raylib"); const FPS_CAPTURE_FRAMES_COUNT : i32 = 30; // 30 captures const FPS_AVERAGE_TIME_SECONDS : f32 = 0.5; // 500 milliseconds @@ -10,13 +11,14 @@ var average : f32 = 0; var last : f32 = 0; pub fn drawFPS(posX : i32, posY : i32, fpsFrame : f32, frame : i32) void { - var color : rl.Color = .lime; // Good FPS + var color : c.Color = c.LIME; + // var color : rl.Color = .lime; // Good FPS const fps : i32 = getFPS(fpsFrame, frame); - if ((fps < 30) and (fps >= 15)) {color = .orange;} // Warning FPS - else if (fps < 15) color = .red; // Low FPS + if ((fps < 30) and (fps >= 15)) {color = c.ORANGE;} // Warning FPS + else if (fps < 15) color = c.RED; // Low FPS - rl.drawText(rl.textFormat("%2i FPS", .{fps}), posX, posY, 20, color); + c.DrawText(c.TextFormat("%2i FPS", fps), posX, posY, 20, color); } pub fn getFPS(fpsFrame : f32, frame : i32) i32 { @@ -34,9 +36,9 @@ pub fn getFPS(fpsFrame : f32, frame : i32) i32 { if (fpsFrame == 0) return 0; - if ((rl.getTime() - last) > FPS_STEP) + if ((c.GetTime() - last) > FPS_STEP) { - last = @floatCast(rl.getTime()); + last = @floatCast(c.GetTime()); index = (index + 1) % FPS_CAPTURE_FRAMES_COUNT; average -= history[index]; history[index] = fpsFrame / FPS_CAPTURE_FRAMES_COUNT;