i-am-shodan/ReTerm

Parameter "fontFamily" must be not null

Closed this issue · 12 comments

First of all thanks a lot for developing this! I've just downgraded my reMarkable 2 OS version to 2.15.1.1189 thanks to rm-update-helper, run opkg update and opkg upgrade, checked rm2fb-client is installed, and am trying to get ReTerm to run, but run in the following error:

reMarkable: ~/ rm -r .ReTerm/  # Clean up
reMarkable: ~/ /home/root/ReTerm/ReTerm.sh
Loading settings file from: /home/root/.ReTerm/settings.json
Settings not found, creating
Created settings dir
Unhandled exception. System.ArgumentNullException: Parameter "fontFamily" must be not null. (Parameter 'fontFamily')
   at SixLabors.ThrowHelper.ThrowArgumentNullException(String name, String message)
   at SixLabors.ThrowHelper.ThrowArgumentNullExceptionForNotNull(String name)
   at SixLabors.Fonts.FontFamilyCollectionExtensions.CreateFont(FontFamily fontFamily, Single size)
   at ReTerm.Program.Main(String[] args)
   at ReTerm.Program.<Main>(String[] args)
/home/root/ReTerm/ReTerm.sh: line 10:   516 Aborted                 /opt/bin/rm2fb-client /home/root/ReTerm/ReTerm
reMarkable: ~/ cat .ReTerm/settings.json 
{
  "DontBlinkCursor": false,
  "DisableMouseAndTouch": false,
  "TouchMarksClearTime": "00:00:10",
  "CursorBlinkInterval": "00:00:00.5000000",
  "ForceBackgroundHexColor": "#FFFFFF",
  "ForceForegroundHexColor": "#000000",
  "FontPath": "",
  "FontName": "",
  "FontSize": 36,
  "KeyboardKeyLookup": null
}

I'm thinking of just adding the line in ~/.ReTerm/settings.json, but I don't know the actually available fonts. Also, this wouldn't fix the bug. Any idea where this came from, if it's beyond a missing line in the config?

Listing the fonts with fc-list and trying out "FontFamily": "Noto Sans" still gives the same failure.

So some thoughts.

I've never tested on 2.5 as the type cover doesn't run on that. It's possible that this is causing an issue.

Where are you getting your copy of ReTerm from, are you using one of the latest releases or installing from opkg?

The error itself is not related to any of the system installed fonts. It's saying it can't load the font we package internally. Which is weird and something no one has ever reported.

It doesn't look like a recent version as KeyboardKeyLookup is set to null

(2.15 not 2.5 -- though that's maybe a tipo)

I downloaded the release-no-dotnet-runtime.zip from the readme, yesterday or this morning (so it's still the last version), unzipped in reMarkable.

I just finished uninstalling Toltec, reinstalling it from scratch, redownloading ReTerm, and it gives me the same error.

reMarkable: ~/ unzip release-no-dotnet-runtime.zip -d ReTerm
unzip: can't change directory to 'ReTerm': No such file or directory
reMarkable: ~/ mkdir ReTerm
reMarkable: ~/ unzip release-no-dotnet-runtime.zip -d ReTerm
Archive:  release-no-dotnet-runtime.zip
  inflating: ReMarkable.NET.pdb
  inflating: ReTerm
  inflating: ReTerm.pdb
  inflating: ReTerm.sh
  inflating: VtNetCore.pdb
reMarkable: ~/ ReTerm/ReTerm.sh
-sh: ReTerm/ReTerm.sh: Permission denied
reMarkable: ~/ chmod +x ReTerm/ReTerm.sh
reMarkable: ~/ ReTerm/ReTerm.sh
Loading settings file from: /home/root/.ReTerm/settings.json
Loading settings
Unhandled exception. System.ArgumentNullException: Parameter "fontFamily" must be not null. (Parameter 'fontFamily')
   at SixLabors.ThrowHelper.ThrowArgumentNullException(String name, String message)
   at SixLabors.ThrowHelper.ThrowArgumentNullExceptionForNotNull(String name)
   at SixLabors.Fonts.FontFamilyCollectionExtensions.CreateFont(FontFamily fontFamily, Single size)
   at ReTerm.Program.Main(String[] args)
   at ReTerm.Program.<Main>(String[] args)
ReTerm/ReTerm.sh: line 10:  2274 Aborted                 /opt/bin/rm2fb-client /home/root/ReTerm/ReTerm
reMarkable: ~/ rm -r .ReTerm/
reMarkable: ~/ ReTerm/ReTerm.sh
Loading settings file from: /home/root/.ReTerm/settings.json
Settings not found, creating
Created settings dir
Unhandled exception. System.ArgumentNullException: Parameter "fontFamily" must be not null. (Parameter 'fontFamily')
   at SixLabors.ThrowHelper.ThrowArgumentNullException(String name, String message)
   at SixLabors.ThrowHelper.ThrowArgumentNullExceptionForNotNull(String name)
   at SixLabors.Fonts.FontFamilyCollectionExtensions.CreateFont(FontFamily fontFamily, Single size)
   at ReTerm.Program.Main(String[] args)
   at ReTerm.Program.<Main>(String[] args)
ReTerm/ReTerm.sh: line 10:  2297 Aborted                 /opt/bin/rm2fb-client /home/root/ReTerm/ReTerm

Could this be related to the downgrade that I did from version 3.5? (Downgrading in order to be able to use Toltec -- yet if there's another way to use ReTerm with the keyboard please let me know).

Maybe to check the version:

reMarkable: ~/ sha1sum release-no-dotnet-runtime.zip 
014dfd394f3809e55646ac0153d21ea54afc9898  release-no-dotnet-runtime.zip

I'm a bit confused about your FW version. You need to be on 3.2 at least for the type folio to work.

I would upgrade to that first

You need to be on 3.2 at least for the type folio to work.

Ah, thanks for that pointer!

So how are rm2fb-client and the Draft launcher installed if the FW is 3.2 or later? I keep reading that Toltec only works up to 2.15.1.1189 for now. Is Toltec not needed, or is there a dev version that works on FW 3.2?

Using 8236b72 instead removes the error (and leads me to the "No keyboard attached" error on the reMarkable screen, which is as you said above).

So a summary:

reMarkable: ~/ rm -r .ReTerm/
reMarkable: ~/ opkg install reterm_20230714.0928-1_rmall.ipk 
Installing reterm (20230714.0928-1) to root...
Configuring reterm.
reMarkable: ~/ which ReTerm
/opt/bin/ReTerm
reMarkable: ~/ ReTerm
Loading settings file from: /home/root/.ReTerm/settings.json
Settings not found, creating
Created settings dir
reMarkable: ~/ ReTerm
Loading settings file from: /home/root/.ReTerm/settings.json
Loading settings
reMarkable: ~/ 

This is all on FW 2.15.1.1189 (which is why the keyboard is not found then).

Although Toltec isn't supported on 3.x it does work provided you don't install any packages that change the kernel.

You should upgrade your rm2 to a version that supports the folio and where rm2fb is supported. There have been big changes in fw 3.x and is suspect not being on this version is where your problems are.

Indeed, the upgrade to fw 3.2.3.1595 made the latest ReTerm work. Thanks!

Eeems commented

@i-am-shodan I'd like for this to be re-opened though, so we can run down why it does this on 2.15. I'm also encountering this on the latest source on my rM1 while running 2.15.

Edit: From some initial investigation I'm doing, it appears to be failing to load the embedded fonts.
Edit2: Okay, that's just because we never got to loading the fonts as it's failed before that has happened.
Edit3: Figured it out. It's due to /sys/pogo/status/lang not existing, and the code assumes it does. I'll be opening a PR soon with this fix and something else I was implementing already.