On Screen Keyboard Display Issue

More
01 Nov 2020 06:39 - 01 Nov 2020 07:21 #187992 by phillc54

What code did you use to change the font on initialization?


I tried:
self.w.gcode_display.setMarginsFont(font)

and:
text = bytearray(str.encode('Arial'))
self.w.gcode_display.SendScintilla(QsciScintilla.SCI_STYLESETFONT, QsciScintilla.STYLE_DEFAULT, text)

But they are now commented out and I cannot remember which one worked. As soon as a file was loaded it reverted to the original default.

Edit: added text = code that I forgot earlier...


Edit2: This worked:
        font = QtGui.QFont()
        font.setFamily('Lato')
        font.setFixedPitch(False)
        font.setPointSize(24)
        font.setBold(False)
        self.w.gcode_display.setMarginsFont(font)

As soon as a file was loaded it reverted to the original default.
Last edit: 01 Nov 2020 07:21 by phillc54.

Please Log in or Create an account to join the conversation.

More
01 Nov 2020 07:12 #187993 by phillc54

Hi Phill,

I submitted a little issue on github. Have a look. I would like to test your version today !


I can load it on a buster rip master branch and a buster local master branch installation.
There is a path issue with 2.8 branch that affects the sim panel so I moved some files and it also works on stretch for rip and local.

Please Log in or Create an account to join the conversation.

More
02 Nov 2020 07:36 #188090 by cmorley
It seems fonts are much more complicated then i may first seem.
There are default fonts, default lexer font and individual lexer style fonts.

For now try this:
        self.font = QFont()
        self.font.setFamily('Lato')
        self.font.setFixedPitch(True)
        self.font.setPointSize(10)
        self.w.gcode_editor.editor.font = self.font
        for i in range(0,4):
            self.w.gcode_editor.editor.lexer.setFont(self.font,i)
        self.w.gcode_editor.editor.set_background_color('#FFFFFF')

I'll need to add convience method to make this easier in the future.

Chris
The following user(s) said Thank You: phillc54

Please Log in or Create an account to join the conversation.

More
03 Nov 2020 22:50 - 03 Nov 2020 22:51 #188278 by phillc54

It seems fonts are much more complicated then i may first seem.
There are default fonts, default lexer font and individual lexer style fonts.

Sorry, I forgot to give this a try yesterday. I quick tryout this morning and it looks good, Thank you.

Edit: It worked in a GcodeDisplay as well.
Last edit: 03 Nov 2020 22:51 by phillc54.

Please Log in or Create an account to join the conversation.

More
08 Nov 2020 02:36 #188639 by cmorley
i add the ability to set background color, lexer text colors. lexer text fonts with stylesheets in master. There are basic docs about it under 'qtvcp widgets'

Hopefully they are useful to you as you can change the colors that work with the rest of the screens colors.

Chris
The following user(s) said Thank You: phillc54, Himarc3D

Please Log in or Create an account to join the conversation.

More
08 Nov 2020 02:52 #188640 by phillc54
Cool, I'll take a peek . I have just about finished the color changing stuff :(

Please Log in or Create an account to join the conversation.

More
08 Nov 2020 03:00 #188641 by JohnnyCNC
I was just looking for virtual keyboard. I'll be watching this with great interest. Thank You.

Please Log in or Create an account to join the conversation.

More
08 Nov 2020 03:18 #188642 by cmorley
JonnyCNC
based on your other post I think you are looking for a virtual keyboard for the system rather then the screen.
matchbox and onscreen keyboard are system widget virtual keyboards.

Thew virtual keyboard in wtvcp only works for the qtvcp screen.

Chris

Please Log in or Create an account to join the conversation.

More
08 Nov 2020 03:47 #188645 by JohnnyCNC
Thanks Chris,

I mainly want it for doing MDI keyins or offset values and the like while I am in QTDragon. I did install the virtual keyboard "Florence" and it does work but what was shown here looks much more conveniant to use while in QTDragon. If I am doing other stuff I'll just use my physical keyboard and mouse.

Please Log in or Create an account to join the conversation.

More
08 Nov 2020 17:23 #188675 by cmorley
JohnnyCNC

QtDragon has a builtin keyboard for MDI and offsets. should be a button on the top right of the tabs - 'KEYBD"

Chris

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.080 seconds
Powered by Kunena Forum