Quantcast
Channel: MobileRead Forums - Kobo Developer's Corner
Viewing all articles
Browse latest Browse all 1563

ePub / KePub font sizes experiments

$
0
0
As per a PM conversation here are two patches which can be used to experiment with some settings relating to fonts sizes used in the ePub and KePub readers. I've posted them here in case others want to experiment and share results.

The patches won't do anything until you edit them and change the replacement values.

Firmware 4.15.12920, for libnickel.so.1.0.0.yaml:
Spoiler:
Code:

Set font scale factor:
  - Enabled: yes
  - Description: |
      This patch sets the font scale factor for ePub and KePub readers.
  # font scale factor is (current font size) / (X+32)
  # original value X=14, so (current font size) / 46 is original scale factor,
  # e.g. selecting font size 46 from the slider gives scale factor 1.0
  # allowed replacement values for X: 0-15 (smaller X --> larger scale factor)
  # ePub:
  - ReplaceInt: {Offset: 0x4A6EBA, Find: 14, Replace: 14}
  # KePub:
  - ReplaceInt: {Offset: 0xA2A5F0, Find: 14, Replace: 14}

Set Adobe units per inch:
  - Enabled: yes
  - Description: |
      This patch sets the value passed to AdobeStyling::setUnitsPerInch(int)
      which only affects the ePub reader.
  # original value is calculated as (scale factor) * X where:
  #  scale factor is as in the previous patch
  #  X = 144.0 for Dragon class devices, X = 96.0 for other devices
  # Other devices (Touch, Glo, etc.):
  - ReplaceBytes: {Offset: 0x4A70C0, FindH: 00 00 C0 42, ReplaceH: 00 00 C0 42}
  # Dragon class devices (AuraHD, H2O, etc.):
  - ReplaceBytes: {Offset: 0x4A70C4, FindH: 00 00 10 43, ReplaceH: 00 00 10 43}
  #
  # Sample replacement values:
  # X = 72.0:  ReplaceH: 00 00 90 42
  # X = 84.0:  ReplaceH: 00 00 A8 42
  # X = 96.0:  ReplaceH: 00 00 C0 42
  # X = 108.0:  ReplaceH: 00 00 D8 42
  # X = 120.0:  ReplaceH: 00 00 F0 42
  # X = 132.0:  ReplaceH: 00 00 04 43
  # X = 144.0:  ReplaceH: 00 00 10 43
  # X = 156.0:  ReplaceH: 00 00 1C 43
  # X = 168.0:  ReplaceH: 00 00 28 43



Edit: As an alternative to the second patch above, this one sets the ePub units per inch to a constant value of 300 instead of a multiple of the font scale factor.
Spoiler:
Code:

Constant Adobe units per inch:
  - Enabled: no
  - Description: |
      This patch sets the value passed to AdobeStyling::setUnitsPerInch(int)
      as a constant instead of a multiple of the scale factor.
  - ReplaceBytes: {Offset: 0x4A6F02, FindH: 17 EE 90 1A, ReplaceH: 48 21 18 31}
  # Replacement value: units per inch = 72 + the replacement value
  # e.g. for 300 units per inch use replacement value 228
  - ReplaceInt: {Offset: 0x4A6F04, Find: 24, Replace: 228}


Viewing all articles
Browse latest Browse all 1563

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>