Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change size of node_text. #392

Open
enaud1984 opened this issue Oct 21, 2023 · 4 comments
Open

Change size of node_text. #392

enaud1984 opened this issue Oct 21, 2023 · 4 comments
Labels

Comments

@enaud1984
Copy link

How change text size of NAME_NODE and internal text input?

thanks

@jchanvfx
Copy link
Owner

jchanvfx commented Oct 23, 2023

Hi @enaud1984

If you're wanting to change the size of the node name on the BaseNode class you can try this snippet by setting the font on the node's view item at init.

Cheers,
J

from NodeGraphQt import BaseNode

class MyNode(BaseNode):

    def __init__(self):
        super(MyNode, self).__init__()

        # change font size of the view text item.
        font = self.view.text_item.font()
        font.setPointSize(8)
        self.view.text_item.setFont(font)

@GTN0707
Copy link

GTN0707 commented Feb 14, 2024

@jchanvfx related to this threat - is it possible to change the font size of backdrop node name as well?

@GTN0707
Copy link

GTN0707 commented Feb 14, 2024

ah nvm please disregard. I found my answer :)
it's editable under class BackdropNodeItem

@jchanvfx
Copy link
Owner

All good adding this here for reference.
https://github.com/jchanvfx/NodeGraphQt/blob/main/NodeGraphQt/qgraphics/node_backdrop.py#L211

Good to know that the text size is a thing will look into exposing some additional functions for adjusting text size to the node class objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants