sony / flutter-elinux

Flutter tools for embedded Linux (eLinux)
BSD 3-Clause "New" or "Revised" License
408 stars 43 forks source link

Can not display the font on wayland on rk3568. #216

Closed fayfive closed 10 months ago

fayfive commented 10 months ago

[✓] eLinux toolchain - develop for embedded Linux devices [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [✓] Chrome - develop for the web [✓] Linux toolchain - develop for Linux desktop

I have created a test by flutter-elinux create test and build it

flutter-elinux build elinux \
     --target-arch=arm64 \
     --target-compiler-triple=aarch64-linux-gnu \
     --target-sysroot=<Absolute_path_to>/ubuntu18-arm64-sysroot

the app can run on the rk3568 weston , but the font is not showed. I can see the assets has the MaterialIcons-Regular.otf My version is 3.13.1 Any suggestions?

HidenoriMatsubayashi commented 10 months ago

First, does it work fine on desktop PC?

HidenoriMatsubayashi commented 10 months ago

I have created a test by flutter-elinux create test and build it

test shouldn't have any font asset after creating this test. Please check your project first. Thanks.

fayfive commented 10 months ago

First, does it work fine on desktop PC?

Work well on PC.

I have created a test by flutter-elinux create test and build it

test shouldn't have any font asset after creating this test. Please check your project first. Thanks.

I don't know what you mean. I don't have any other fonts

ls build/elinux/arm64/release/bundle/data/flutter_assets/fonts/
MaterialIcons-Regular.otf
HidenoriMatsubayashi commented 10 months ago

I see.

the app can run on the rk3568 weston , but the font is not showed.

What does it mean? No messages like "You have pushed the button this many times:" ?

Did you copy build/elinux/arm64/release/bundle directory to your target device?

fayfive commented 10 months ago

I see.

the app can run on the rk3568 weston , but the font is not showed.

What does it mean? No messages like "You have pushed the button this many times:" ?

Did you copy build/elinux/arm64/release/bundle directory to your target device?

You're right. The Text is not be showed and blank.

mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:', // can not be show blank
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium, 
            ), // can not be show blank
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton( // work well
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), 

I have copied bundle to the target device

@RK356X:/root/bundle# ls data/flutter_assets/fonts/MaterialIcons-Regular.otf 
data/flutter_assets/fonts/MaterialIcons-Regular.otf

I have change the backgroundColor to red and can be changed.

HidenoriMatsubayashi commented 10 months ago

How about run flutter-elinux run -d elinux-wayland --release directory on rk3568 without cross-building? Does it work?

fayfive commented 10 months ago

How about run flutter-elinux run -d elinux-wayland --release directory on rk3568 without cross-building? Does it work?

My system is linux not ubuntu or centos. So I can not build on the board. I run it with debug and show that

root@RK356X:/root/bundle# ./elinux -b ./ -d
arm_release_ver of this libmali is 'g2p0-01eac0', rk_so_ver is '3'.flutter: The Dart VM service is listening on http://127.0.0.1:34819/ER0wF2Okqq0=/
HidenoriMatsubayashi commented 10 months ago

Okay, but unfortunately, I have no more ideas at the moment.

fayfive commented 10 months ago

I have change the font to DejaVuSansMono.ttf and works well. Maybe other fonts will works well too.