fyne icon indicating copy to clipboard operation
fyne copied to clipboard

Why does the memory increase after loading the font

Open leessmin opened this issue 1 year ago • 9 comments

Checklist

  • [X] I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • [X] This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

There is no memory when the font is loaded 1 Memory when the font is loaded 2 Added 60MB of memory

Is it possible to construct a solution with the existing API?

No response

Describe the solution you'd like to see.

I think the memory is too large, do I have any solution that does not load fonts to display Chinese characters

leessmin avatar Jan 21 '24 15:01 leessmin

Currently we load the full font into memory for speed. That increase is the size of the font uncompressed. Not sure what we can do about that?

andydotxyz avatar Jan 21 '24 21:01 andydotxyz

Currently we load the full font into memory for speed.

That increase is the size of the font uncompressed.

Not sure what we can do about that?

Can I use the system default font directly,My aim is to support Chinese rather than using fonts

leessmin avatar Jan 21 '24 23:01 leessmin

Can I use the system default font directly,My aim is to support Chinese rather than using fonts

This is not currently possible but hopefully will be available in Fyne 2.5 which aims to support internationalization

dweymouth avatar Jan 21 '24 23:01 dweymouth

Even using system fonts we will still be loading the data into memory.

andydotxyz avatar Jan 22 '24 08:01 andydotxyz

Can I use the system default font directly,My aim is to support Chinese rather than using fonts

This is not currently possible but hopefully will be available in Fyne 2.5 which aims to support internationalization

I'm looking forward to fyne v2.5

leessmin avatar Jan 22 '24 09:01 leessmin

Even using system fonts we will still be loading the data into memory.

Is there any way to reduce the memory consumed by fonts

leessmin avatar Jan 22 '24 09:01 leessmin

Even using system fonts we will still be loading the data into memory.

Is there any way to reduce the memory consumed by fonts

In a future version we will have to look at lazy loading of glyph information. This will probably need to begin with work in the go-text project as the data loading all happens there now I think.

andydotxyz avatar Jan 22 '24 10:01 andydotxyz

Even using system fonts we will still be loading the data into memory.

Is there any way to reduce the memory consumed by fonts

In a future version we will have to look at lazy loading of glyph information.

This will probably need to begin with work in the go-text project as the data loading all happens there now I think.

Thank you for your answers and look forward to further optimizing this memory in future versions

leessmin avatar Jan 22 '24 14:01 leessmin

Developing Chinese software requires a built-in font, and any font file needs to be 10M in size, which is crazy

junmaqiang avatar Jan 26 '24 15:01 junmaqiang