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

[WIP] Font #141

Merged
merged 16 commits into from
Jun 9, 2018
Merged

[WIP] Font #141

merged 16 commits into from
Jun 9, 2018

Conversation

mischnic
Copy link
Contributor

@mischnic mischnic commented May 20, 2018

That FancyText (not sure about the name) isn't implemented yet
-> How can a React.Component determine the type of it's parents?


@kusti8 What should the default font family and size be (currently Arial 14pt)?

bildschirmfoto 2018-05-22 um 19 37 02

Closes #138

Some libui bugs:

@kusti8
Copy link
Owner

kusti8 commented May 27, 2018

Ok, its hard to get a component to know its parents. I sort of did something like that here https://github.com/kusti8/proton-native/blob/yoga/src/components/View.js, where I used the parent component and then basically chained function calls all the way up to the root. Default font should be Arial either 12pt or 14pt. Currently 12pt is pretty standard so that should be good.

I'll work on FancyText, (I'm thinking StyledText). Anything else that needs to be done?

@mischnic
Copy link
Contributor Author

I'll work on FancyText, (I'm thinking StyledText).

👍

Anything else that needs to be done?

Everything from the libui api should be implemented (except for OpenTypeFeatures which can for example be used to turn on/off ligatures).

@kusti8
Copy link
Owner

kusti8 commented Jun 2, 2018

I added StyledText and I got the parent by using React Context. To do this, I had to upgrade react-reconciler so I had to make some changes so I need to test it more before merging.

@mischnic
Copy link
Contributor Author

mischnic commented Jun 2, 2018

This needs to be adjusted to accept StyledText: (bottom of components/Area.js)

Area.Text.propTypes = {
  children: PropTypes.oneOfType([areaProp, PropTypes.arrayOf(areaProp)]),
};

@kusti8
Copy link
Owner

kusti8 commented Jun 9, 2018

Looks like this is done. I'll merge if that's good with you @mischnic


const font = new libui.FontDescriptor(
'Arial',
14,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is done. I'll merge if that's good with you @mischnic

👍

You might want to change this to 12 for the default font (that's also the default font size of the font button on macOS).

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

Successfully merging this pull request may close these issues.

2 participants