Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Feature request: Option to set the application's default font

2 posters

Go down  Message [Page 1 of 1]

royqh1979



Now simulide use "ubuntu" as the default application font, and ubuntu-*.ttf are distributed with the app.
But it only contains ascii characters, so non-ascii chars are displayed using the system's default sans-serif font.

The result is not very good in Simplified Chinese Windows. The default font "宋体" is good for printing but not for dipslayed in LED. It's a bit too thin, for users whoes eyes are not very good like me. I'd like to use a bold font, like "微软雅黑(Microsoft YaHei)".

It would be very nice if the application's default font can be setted by users.

arcachofo

arcachofo

It would be very nice if the application's default font can be setted by users.
Yes, that would be useful.
But there are many places to set the new font, GUI, dialogs, message panels...

royqh1979



arcachofo wrote:
It would be very nice if the application's default font can be setted by users.
Yes, that would be useful.
But there are many places to set the new font, GUI, dialogs, message panels...

We can use qApp->setFont() to set the application's default UI font.

I've made a demo patch:
- Add a new option "Font" in the application settings dialog.
- By default, the font name is "Ubuntu".
- Changes to "Font" are only in effect when restart.
- Use qApp->setFont() to set the default GUI font when simulide start.
- All places that use "Ubuntu" font are changed to use the "Font" setting.
Attachments
Feature request: Option to set the application's default font  Attachmentfont.zip
You don't have permission to download attachments.
(3 Kb) Downloaded 1 times

arcachofo

arcachofo

Thanks.

In any case I'm investigating this issue right now, Ubuntu font should have non-ascii including many languages.

royqh1979



arcachofo wrote:Thanks.

In any case I'm investigating this issue right now, Ubuntu font should have non-ascii including many languages.


Languages in Easy Asian, such as Japanese and Chinese has more thatn 10000 different characters. Most fonts don't have these characters.

Microsoft yahei is a typical ttf chinese font. The size of it is about 20M.

As for U+2795/U-2796(heavy '+'/'-'), which are used to display +/- symbols in opamp / csource, I've used fc-query to see the infos in UbuntuMono-R.ttf:

Code:

        charset:
        0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
        0001: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
        0002: ffffffff ffffffff 0000ffff 00000000 00040000 10000000 3f0002c0 00000000
        0003: 00020000 00000000 00000000 00000000 ffffd770 fffffffb 00007fff 00000000
        0004: ffffffff ffffffff ffffffff 003c000c fffffc00 ffffffff ffffffff 03ffffff
        001e: 00000000 00000000 00000000 00000000 0000003f 00000000 00000000 000c0000
        001f: 3f3fffff ffffffff aaff3f3f 3fffffff ffffffff ffdfffff efcfffdf 7fdcffff
        0020: 77380000 06010047 00000010 03f10000 000003ff 02105000 00000000 00000000
        0021: 00480000 00004044 7ff80000 00000000 00000000 00000000 00000000 00000000
        0022: 46268044 00000800 00000100 00000031 00000000 00000000 00000000 00000000
        0025: 11111005 10101010 ffff0000 00001fff 000e0100 00000000 00000400 00000000
        00e0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 80000000
        00ef: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 20000000
        00f0: 00000007 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        00f5: 0003ffc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        00f8: 3ffffc00 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        00fb: 00000006 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        00ff: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 20000000

It's clear that '0027' is not in the charset list, so U+2795/U+2796(Heavy +/-) are not supported by Ubuntu Mono font.
Could we use normal '+'/'-' instead?

arcachofo

arcachofo

I see... Ubuntu font doesn't contain even Japanese Hiragana or Katakana.
In any case your patch solves the issue.

It's clear that '0027' is not in the charset list, so U+2795/U+2796(Heavy +/-) are not supported by Ubuntu Mono font.
Could we use normal '+'/'-' instead?
Normal '+'/'-' don't look very well, but i guess there is no easy option here.

royqh1979



arcachofo wrote:Normal '+'/'-' don't look very well, but i guess there is no easy option here.

Maybe we could use a bigger font size here? I've tried to use +/- and set font size to 11,
it seems that the result are not that bad.

Feature request: Option to set the application's default font  Snap122

arcachofo

arcachofo

I'm experimenting and most similar for me is font size 9 and U+2013 for "-".

arcachofo

arcachofo

Added some other trick and it is very similar now ( font size=9, "+", U+2013, at the right side):

Feature request: Option to set the application's default font  Opamp10

arcachofo

arcachofo

Font patch applied at Rev 1897.
Fix +- Pin symbols at Rev 1899.

royqh1979



arcachofo wrote:Added some other trick and it is very similar now ( font size=9, "+", U+2013, at the right side):

Feature request: Option to set the application's default font  Opamp10

Nice. It can be correctly displayed by debian 12's default font Very Happy

I failed to compile simulide with msys2+gcc 13, so I can't test it in windows now Sad

arcachofo

arcachofo

I failed to compile simulide with msys2+gcc 13, so I can't test it in windows now
Seems that gcc 13 is a bit too recent?
But what is the problem?

royqh1979



arcachofo wrote:
I failed to compile simulide with msys2+gcc 13, so I can't test it in windows now
Seems that gcc 13 is a bit too recent?
But what is the problem?

en, in SimulIDE.pro, the following line won't work

Code:

BUILD_DATE = $$system($(which date) +\"\\\"%d-%m-%y\\\"\")

And these two lines will fail because resource/qm doesn't exists by default.

Code:

$(MOVE) ../resources/translations/*.qm ../resources/qm; \
$(MOVE) ../resources/translations/qt/*.qm ../resources/qm;

arcachofo

arcachofo

en, in SimulIDE.pro, the following line won't work

Code:

BUILD_DATE = $$system($(which date) +\"\\\"%d-%m-%y\\\"\")
Have a look to this discussion, maybe there is some solution that works for you:
https://simulide.forumotion.com/t88p50-compiling-simulide-under-windows#5573

And these two lines will fail because resource/qm doesn't exists by default.

Code:

$(MOVE) ../resources/translations/*.qm ../resources/qm; \
$(MOVE) ../resources/translations/qt/*.qm ../resources/qm;
This can happen if qmake failed with the previous issue.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum