Skip to content

Font: unify font styling and KeyValuePage: improve looks#2814

Merged
houqp merged 3 commits intokoreader:masterfrom
Frenzie:keyvaluepage_looks
Apr 29, 2017
Merged

Font: unify font styling and KeyValuePage: improve looks#2814
houqp merged 3 commits intokoreader:masterfrom
Frenzie:keyvaluepage_looks

Conversation

@Frenzie
Copy link
Copy Markdown
Member

@Frenzie Frenzie commented Apr 25, 2017

Fixes #2578.

  • key bolded
  • values normally left-aligned at 50%
  • allows misalignment for the sake of fitting everything on one line

Before

screenshot_2017-04-25_20-02-53

After

screenshot_2017-04-25_20-01-48

Before

screenshot_2017-04-25_20-03-00

After

screenshot_2017-04-25_20-02-08

Before

screenshot_2017-04-25_20-08-34

After

screenshot_2017-04-25_20-08-58

Overflow

screenshot_2017-04-25_20-02-33

This change is thanks to @houqp, because otherwise I'd have spent my time on #2809 instead. ;-)

@Frenzie Frenzie force-pushed the keyvaluepage_looks branch 2 times, most recently from 2d19b06 to e890ae8 Compare April 25, 2017 18:17
@Frenzie Frenzie added the UX label Apr 25, 2017
@poire-z
Copy link
Copy Markdown
Contributor

poire-z commented Apr 26, 2017

Couldn't we also decrease font size, and add some small margin to the page ?
(I actually like how the book status page looks, it's sharp and clean, compared to the original keyvaluepage.)

@Frenzie
Copy link
Copy Markdown
Member Author

Frenzie commented Apr 26, 2017

I'm personally fine with that but do note #2563.

@poire-z
Copy link
Copy Markdown
Contributor

poire-z commented Apr 26, 2017

Yes indeed (dunno how that book status looks on kobo mini, if it's unreadable or if there's there some font adjusment depending on device screen).

@Frenzie
Copy link
Copy Markdown
Member Author

Frenzie commented Apr 26, 2017

It did occur to me that I ever so slightly mismatched the font sizes and didn't even notice (I thought it was because it was bold).

From font.lua:

        cfont = 24,
        tfont = 26,

The size @baskerville used was 21, so I've tried 22 instead. On the screenshot implementing your suggestion looks a fair bit better, but on anything with a bigger screen it should look fairly similar even with size 24 and some padding.

screenshot_2017-04-26_14-55-52
screenshot_2017-04-26_14-56-01
screenshot_2017-04-26_14-56-08

if key_w >= value_w then
self.show_key = RenderText:truncateTextByWidth(self.key, self.cface, self.width-value_w)
self.show_value = self.value
local frame_padding = 8
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

where is this magic number 8 coming from? If it's used somewhere else in this module, we should create a module global variable for it or reuse the same variable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

From @poire-z's suggestion to add padding? That is, just from playing around with a few values.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i see. We should use Screen:scaleBySize on raw numbers to make it consistent on different screen sizes.

key = nil,
value = nil,
cface = Font:getFace("cfont"),
cface = Font:getFace("cfont", 22),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Font size should be wrapped by Screen:scaleBySize. And I suggest changing the default size in Font module so we get a consistent experience across the app.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It shouldn't; that's done by getFace and if it weren't that's still where it should be done. ;-)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ha, good catch, I forgot Font module already does this internally ;)

@houqp
Copy link
Copy Markdown
Member

houqp commented Apr 27, 2017

Two nitpicks, the rest looks good to me. It looks much better after the patch 👍

Fixes koreader#2578.

* key bolded
* values normally left-aligned at 50%
* allows misalignment for the sake of fitting everything on one line
@Frenzie Frenzie force-pushed the keyvaluepage_looks branch 2 times, most recently from 328ebdb to 40321ff Compare April 29, 2017 08:48
@Frenzie Frenzie force-pushed the keyvaluepage_looks branch 3 times, most recently from 8669694 to b397712 Compare April 29, 2017 09:46
@Frenzie Frenzie changed the title KeyValuePage: improve looks Font: unify font styling and KeyValuePage: improve looks Apr 29, 2017
@Frenzie Frenzie force-pushed the keyvaluepage_looks branch from b397712 to 1c47d73 Compare April 29, 2017 09:50
@Frenzie Frenzie force-pushed the keyvaluepage_looks branch from 1c47d73 to a552c1a Compare April 29, 2017 09:52
@houqp houqp merged commit e1aa57f into koreader:master Apr 29, 2017
@Frenzie Frenzie deleted the keyvaluepage_looks branch April 29, 2017 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants