Commit graph

310 commits

Author SHA1 Message Date
bunnie
dee4871f91 fix truncated "l" in some cases on wide fonts
minimum width should not be truncated to 0 during layout!
2023-07-06 16:15:49 +08:00
bunnie
17fb590d9a fix typsetter overflow check
got the axes inverted. oops.
2023-07-05 15:38:49 +08:00
bunnie
b2c64eb61a aesthetic cleanup; change default font for all modals
I decided to go back on the idea of not changing the modals
and now all modals use the new larger font as well.

This creates issue #396, which I will deal with later once
I have the time to do some more testing. I'm pretty sure
some other dialog boxes are broken now too.
2023-07-05 15:13:38 +08:00
bunnie
4454dffe4e generate loader files for the new font
also sort the font files in alphabetical order now,
instead of relying on arbitrary ordering of os.listdir() :P
2023-07-05 14:44:30 +08:00
bunnie
2f54ae39d4 Merge branch 'fonts' into main 2023-07-05 13:47:26 +08:00
bunnie
dfffa48715 move default system font to gam/src/lib.rs SYSTEM_STYLE
default system font can be statically changed by modifying
the SYSTEM_STYLE constant.

This of course will lead to a request for a dynamically
configurable preference for font size. However, early
on it was decided this is a bad idea. Here's why.

We don't provide for dynamic system-wide font selection
because this adds a lot of complexity to what would otherwise
be static code: this is a deliberate choice to improve code
density and performance. If the system font were dynamically
adjustable, then every character rendered we would potentially
have to query the PDDB for the current system font setting.

The impact of this could be mitigated by caching values but
then what happens when you actually change the font? now
you need a registry to fire messages off to all dependent
crates with cached values to flush their caches and redraw
(or you punt and force a reboot if you change font sizes,
but still, you're creating a dependency on a lot of plumbing
for even the simplest crates).

Plus, with a static font selection, the compiler can take constants
like the font height and compose them with other fitting
parameters into optimized load/stores of borders and spacings
for the static case; if you make it dynamic, all those multiplies,
adds and divides now get pulled into the main rendering loop
and are recomputed all the time. For example, if you have a static
const list of items that need to be rendered, even if the code to
compute the height of the list is written as a for loop, the compiler
will know the list is constant, and the font height is constant,
and it can condense that all into a single number at compile time,
eliminating all the code for the for loop.

If you leave the option open to change that, that entire piece
of code has to be generated and executed even though in practice
nobody changes the parameter.
2023-07-05 13:39:11 +08:00
bunnie
ec3fc70a66 rework the font rendering engine and style macros to support Tall
this reworks the necessary routines on the font rendering engine
and within the style selection macros to support the new Tall font.
2023-07-05 13:37:41 +08:00
bunnie
aab25f2d53 add Tall font face and support for 32x32 bitmaps
Thanks to @samblenny for getting the ball rolling on this.

This commit adds a "tall" font face which is somewhere in betwee
the Regular size (12 pts) and 2x Small size (18 pts). This is
a compromise between text density and readability that has been
missing for some time from the UI.

The 32x32 glyph support is "hacked in", in that an extra flag
has been added to support this special case, rather than either
(a) making the library more generic (e.g. supporting 8x, 16x, 32x, 64x
glyphs) or (b) adding more metadata to the font libraries so that
the bitmap pattern is automatically associated with the font (right
now the parameters are set by hand in blitstr2/fonts.rs).

This is a violation of the "zero, one, many" principle in coding,
but I'm waiving that because (a) 64x glyphs don't make sense on
our system...you're not going to be creating posters and headlines
on this device (ha ha I say this today, tomorrow I will get a PR
for a poster editor app that absolutely needs 64x glyphs) and (b)
the font subsystem is, at least for now, a fairly mature and
well-tested code base so a minor futzing seems more appropriate
than ripping everything out.

The point at which things should be greatly refactored is when
we consider supporting right-to-left scripts or scripts that
require complex ligatures. But I think for now the system as
writ covers 80% of humanity's language needs acceptably
(but not perfectly).
2023-07-05 12:43:44 +08:00
bunnie
4ac979f0ab update pins, again 2023-07-04 11:20:12 +08:00
bunnie
c9f8f2681b update version pins 2023-07-04 11:09:13 +08:00
bunnie
ae1adbfedd fix template to match manual patch-ups on config flags 2023-07-04 10:32:15 +08:00
bunnie
22e0e06625 check in inital artifacts, but leave the system inert
more hacking is necessary before we can really run these scripts
2023-07-04 10:29:43 +08:00
bunnie
952ba18fba commit vesrion pin bumps 2023-06-16 01:30:18 +08:00
Jean-Pierre De Jesus DIAZ
2af737b57e
xous-rs: move LANG variable to locales
This change is made with the intention of making the xous-rs crate a bit
more freestanding without depending on the xtask build system.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-06-15 18:23:12 +02:00
bunnie
fbe3cb2a3d bump package numbers to absorb PR #388 2023-05-28 15:58:11 +08:00
bunnie
5a2df4432c technical debt: cleanup UTRA package
- make the "base" field no longer public. It is accessible, but only
through an `unsafe` method, because, it is unsafe.
- add accessors to offest/mask fields. Because, it's not at all
unsafe to access these, and it can be useful for bit-ops that are
not part of the generic set of UTRA.
- add Arc to AtomicCSR, and require `std` for AtomicCSR types.
This should not break anything, I checked inside @foundation-devices
keyOS and they don't seem to be using AtomicCSR anywhere.

The Arc makes it a bit safer to clone the AtomicCSR base pointer
and share it between threads, but it will have an impact on performance.
The USB stack (which requires AtomicCSR) was regression testing and the
impact seems minimal.

Recall that the main purpose of AtomicCSR is to provide a CSR accessor
that does not require a mutable reference to the base object. This
can make certain Rust idioms a bit cleaner. We wrap the base accessor
in Arc+Atomic to try and improve the safety of throwing the borrow
checker under the bus, but it's still not perfect because hardware
mutable state can have side-effects within hardware itself that cannot
be modeled or checked by Rust's borrow checker.
2023-05-23 18:11:24 +08:00
bunnie
697d44de3d bump version pins to absorb changes to svd2utra etc. 2023-05-03 23:11:12 +08:00
Sean Cross
6eb6fae061 graphics-server: apply macos patch to fix build
This fixes the build of `graphics-server` on macos.
This is recommended by @bunnie in
https://github.com/betrusted-io/xous-core/issues/373#issuecomment-1526015174

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-28 00:05:28 +07:00
bunnie
9022fe6827 revert change to patch over macos 2023-04-28 00:31:48 +08:00
yvt
8504b6fc6b fix(graphics-server): convert "never" types
Fixes build failure due to a type mismatch between `Never` and `!`
in `claim_main_thread`.
2023-04-28 01:23:49 +09:00
bunnie
0522cf9c93
Merge pull request #374 from yvt/patch/fix-minifb-on-main-thread
graphics-server: Run `minifb` event loop on main thread
2023-04-28 00:05:23 +08:00
yvt
c9fd805da2 fix(graphics-server): run minifb event loop on main thread
Fixes crashes on macOS.

Some operating systems and GUI frameworks, in particular Cocoa, don't
allow creating an event loop from a thread other than the main thread
(TID 1) and will abort a program on violation.
2023-04-28 00:43:39 +09:00
bunnie
b2475e47ca provide a workaround for #373
I can't test it, but, it basically just takes the code pre #372
and provides it to macos targets.

I think the update() method is ok to just remove, but, if something
doesn't work there that would probably be the root cause.
2023-04-27 23:27:29 +08:00
bunnie
8a574f937f bump for xous-rs version pin update 2023-04-27 22:18:30 +08:00
yvt
e8aba2810a refactor(graphics-server): remove backend::XousDisplay::update
It's no longer necessary because the `minifb` backend now automatically
calls `minifb::Window::update_with_buffer` in a dedicated thread.
2023-04-26 00:13:58 +09:00
yvt
679a1b2b12 fix(graphics-server): call minifb::Window::update_with_buffer continuously in a dedicated thread
This method needs to be called continuously to pump input events. Fixes
massive keyboard input latency in hosted mode.
2023-04-26 00:13:55 +09:00
bunnie
1392fdcf33 bump pins for updated log API 2023-04-16 02:27:37 +08:00
bunnie
849c136b90 bump versions because API crate changed 2023-04-12 23:02:30 +08:00
bunnie
8357ab31a5 bump all pins because utralib got updated 2023-04-09 00:48:35 +08:00
bunnie
9c94d6b4c0 bump versions because xous-rs API changed for gdb-stub 2023-04-08 23:49:24 +08:00
bunnie
e469eba167 bump version for utralib patch 2023-04-04 02:13:02 +08:00
bunnie
704aaf98af bump versions for kernel interface changes 2023-03-22 02:48:55 +08:00
bunnie
303f595d6f bump versions to cleanup renode.rs sync issue 2023-03-14 16:34:53 +08:00
bunnie
82e3aa322f bump toml files in prep for publish 2023-03-08 03:54:37 +08:00
bunnie
9256e7cc09 bump versions to absorb xous-names fix 2023-01-31 15:07:32 +08:00
bunnie
84368c3f3a bump versions for publication 2023-01-31 02:18:12 +08:00
bunnie
232a4b6c6c bump xous version 2023-01-18 00:02:46 +08:00
bunnie
41d4837551 bump versions to absorb WDT change 2023-01-06 17:48:12 +08:00
bunnie
bb5d7b3adf bump versions to absorb hosted mode fix 2023-01-05 14:07:24 +08:00
bunnie
36398810dd bump version numbers to absorb new syscalls 2022-12-30 15:24:36 +08:00
bunnie
5370ce396d bump all revs due to SoC artifact update 2022-12-12 16:07:20 +08:00
bunnie
8d8dd2bd2f fix typo in unwrap message 2022-12-11 16:41:25 +08:00
bunnie
1d1b3a35b7 commit version bump 2022-11-26 10:00:44 +08:00
bunnie
aa9977cc58 bump all the things because we changed utralib again 2022-11-17 22:13:40 +08:00
bunnie
dabbfd6c35 bump all the things to absorb the SoC change 2022-11-17 19:39:18 +08:00
bunnie
a7162fd03c bump xous-names dependents 2022-11-07 22:19:38 +08:00
bunnie
30583bdf07 bump versions with xous change 2022-11-06 03:48:12 +08:00
bunnie
e240ca6499 refactor the hardware boot screen
- remove a blanking operation. this makes the transision from
loader to runtime almost imperceptably smoother
- add the ability to summon the logo screen earlier in the process

Note that only GAM can call GFX, so, it's alright to expose that
API, since GAM should gate-keep and prevent abuse of that function.
2022-11-06 03:10:00 +08:00
bunnie
ba28dd8795 bump to absorb utralib straggler configs 2022-10-28 15:11:17 +08:00
bunnie
dfb10ed7f2 bump crate numbers to publish lang-fr change into xous-rs 2022-10-28 14:01:09 +08:00