brand new font

This commit is contained in:
IonutParau 2025-06-28 21:09:29 +02:00
parent 687cfebd00
commit 2a74e87276
5 changed files with 101 additions and 3 deletions

46
data/OpenOS/LICENSE Normal file
View File

@ -0,0 +1,46 @@
Copyright (c) 2013-2015 Florian "Sangar" Nücke
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-------------------------------------------------------------------------------
All images / textures and localization strings (resources) are put in the
public domain, unless explicitly excluded below. More specicially, see CC0 1.0
Universal:
http://creativecommons.org/publicdomain/zero/1.0/
Contributions:
PixelToast - Capacitor textures.
asie - Disk drive inject/eject and floppy disk access sound samples.
Thanks a lot!
-------------------------------------------------------------------------------
The font used for screens and for monospace text in manual is unscii, made by
viznut, and was further expanded by asie. For more information, please see:
https://github.com/asiekierka/unscii-asie
-------------------------------------------------------------------------------
Assets from other sources:
HDD access samples based on this sample from freesound.org:
https://www.freesound.org/people/artykris/sounds/117401/

View File

@ -1,3 +1,52 @@
--[[
Copyright (c) 2013-2015 Florian "Sangar" Nücke
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-------------------------------------------------------------------------------
All images / textures and localization strings (resources) are put in the
public domain, unless explicitly excluded below. More specicially, see CC0 1.0
Universal:
http://creativecommons.org/publicdomain/zero/1.0/
Contributions:
PixelToast - Capacitor textures.
asie - Disk drive inject/eject and floppy disk access sound samples.
Thanks a lot!
-------------------------------------------------------------------------------
The font used for screens and for monospace text in manual is unscii, made by
viznut, and was further expanded by asie. For more information, please see:
https://github.com/asiekierka/unscii-asie
-------------------------------------------------------------------------------
Assets from other sources:
HDD access samples based on this sample from freesound.org:
https://www.freesound.org/people/artykris/sounds/117401/
]]
local init local init
do do
local component_invoke = component.invoke local component_invoke = component.invoke

View File

@ -141,7 +141,7 @@ void nni_gpu_set(nni_gpu *gpu, void *_, nn_component *component, nn_computer *co
} }
int current = 0; int current = 0;
while(s[current]) { while(s[current] != 0) {
int codepoint = nn_unicode_codepointAt(s, current); int codepoint = nn_unicode_codepointAt(s, current);
nn_setPixel(gpu->currentScreen, x, y, nni_gpu_makePixel(gpu, s + current)); nn_setPixel(gpu->currentScreen, x, y, nni_gpu_makePixel(gpu, s + current));
if(isVertical) { if(isVertical) {

View File

@ -315,6 +315,8 @@ int main() {
SetConfigFlags(FLAG_WINDOW_RESIZABLE); SetConfigFlags(FLAG_WINDOW_RESIZABLE);
InitWindow(800, 600, "emulator"); InitWindow(800, 600, "emulator");
Font unscii = LoadFont("unscii-16-full.ttf");
double lastTime = nn_realTime(); double lastTime = nn_realTime();
while(true) { while(true) {
if(WindowShouldClose()) break; if(WindowShouldClose()) break;
@ -362,7 +364,8 @@ render:
int scrW = 1, scrH = 1; int scrW = 1, scrH = 1;
nn_getResolution(s, &scrW, &scrH); nn_getResolution(s, &scrW, &scrH);
int pixelHeight = GetScreenHeight() / scrH; int pixelHeight = GetScreenHeight() / scrH;
int pixelWidth = MeasureText("A", pixelHeight); float spacing = (float)pixelHeight/10;
int pixelWidth = MeasureTextEx(unscii, "A", pixelHeight, spacing).x;
for(size_t x = 0; x < scrW; x++) { for(size_t x = 0; x < scrW; x++) {
for(size_t y = 0; y < scrH; y++) { for(size_t y = 0; y < scrH; y++) {
@ -373,7 +376,7 @@ render:
Color fgColor = ne_processColor(p.fg); Color fgColor = ne_processColor(p.fg);
Color bgColor = ne_processColor(p.bg); Color bgColor = ne_processColor(p.bg);
DrawRectangle(x * pixelWidth, y * pixelHeight, pixelWidth, pixelHeight, bgColor); DrawRectangle(x * pixelWidth, y * pixelHeight, pixelWidth, pixelHeight, bgColor);
DrawText(s, x * pixelWidth, y * pixelHeight, pixelHeight - 5, fgColor); DrawTextEx(unscii, s, (Vector2) {x * pixelWidth, y * pixelHeight}, pixelHeight - 5, spacing, fgColor);
} }
} }

BIN
unscii-16-full.ttf Normal file

Binary file not shown.