Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > justRead.app

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 10:16 AM   #1
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 85,778
Karma: 154365285
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Proper font weight

When is JustRead going to have proper font weight? The way it's done now is all wrong.

This is from Ai, but it's spot on.

Quote:
"Kobo’s font weight slider doesn't map to CSS font-weight (400–900) or switch between static font files. Under the hood, Kobo uses FreeType’s FT_Outline_Embolden (plus stem-darkening/gamma adjustment) to mathematically dilate the vector outlines of a single Regular .ttf file before rasterization.

On iOS WKWebView, mapping a weight slider to CSS font-weight does nothing on static fonts until it hits 600 and snaps to an ugly faux-bold. To properly replicate Kobo’s smooth weight slider for static fonts in WebKit, the slider needs to adjust glyph stroke thickness smoothly—for example, by scaling a fractional -webkit-text-stroke (e.g., 0.005em to 0.04em currentColor) or subpixel text-shadow dilation—while only using font-variation-settings: 'wght' when a variable font is detected."
Quote:
How Kobo Actually Does It (Under the Hood)

Kobo’s Advanced Font Control weight slider does not rely on CSS font-weight numbers (400, 500, 600) or multi-weight font files. Instead, it operates directly inside Kobo's text rasterizer (FreeType / Adobe RMSDK):
1. Vector Outline Emboldening (FT_Outline_Embolden): Before a glyph is turned into pixels on the screen, FreeType takes the raw mathematical Bézier curves of the font's Regular face and mathematically dilates (expands) the outlines outward by a fractional pixel amount. Because it expands the vector curves before rasterization, the letterforms stay razor-sharp at any size without blurry edges.
2. Gamma & Stem-Darkening Adjustment: Kobo pairs that outline expansion with FreeType's stem darkening and gamma curve tuning, which boosts the subpixel/grayscale contrast of thin horizontal and vertical stems so they appear heavier and darker against the background without altering character spacing or line breaks.

Why iOS App Authors Get It Wrong (and How They Can Fix It)

Most iOS reading app developers simply bind their "Font Weight" slider to CSS font-weight: 100..900. On iOS (WKWebView), if a user loads a standard static .ttf file that only contains a Regular (400) face, WebKit ignores 450, 500, and 550, and then abruptly triggers an ugly synthetic faux-bold at 600+.
If an iOS developer wants to replicate Kobo’s smooth, continuous weight slider for any static font inside WKWebView, they can simulate vector emboldening using subpixel CSS stroke/shadow techniques rather than relying on font-weight:
• Subpixel -webkit-text-stroke: Applying a fractional stroke width in em units (for example, -webkit-text-stroke: 0.015em currentColor expands the glyph outlines proportionally to the font size, mimicking FreeType's outline emboldening.
• Subpixel text-shadow layering: Layering ultra-tight, zero-blur shadows (e.g., text-shadow: 0.01em 0 0 currentColor, -0.01em 0 0 currentColor thickens vertical stems smoothly in tiny increments (0.005em steps) without triggering WebKit's jarring faux-bold jump or changing word wrapping.
• Variable Font wght Axis Fallback: When a user imports a true variable font (one with a wght axis), the slider can drive font-variation-settings: 'wght' <value> directly, reserving the -webkit-text-stroke / text-shadow dilation for static .ttf/.otf files.
JSWolf is offline   Reply With Quote
Old Today, 02:11 PM   #2
petrjahoda
Guru
petrjahoda ought to be getting tired of karma fortunes by now.petrjahoda ought to be getting tired of karma fortunes by now.petrjahoda ought to be getting tired of karma fortunes by now.petrjahoda ought to be getting tired of karma fortunes by now.petrjahoda ought to be getting tired of karma fortunes by now.petrjahoda ought to be getting tired of karma fortunes by now.petrjahoda ought to be getting tired of karma fortunes by now.petrjahoda ought to be getting tired of karma fortunes by now.petrjahoda ought to be getting tired of karma fortunes by now.petrjahoda ought to be getting tired of karma fortunes by now.petrjahoda ought to be getting tired of karma fortunes by now.
 
Posts: 624
Karma: 3774598
Join Date: Dec 2025
Location: Czech Republic
Device: iphone, ipad
Please, what is wrong with font weight exactly in JustRead? Does it not work?

JustRead surely does not work, like you suggest:
Most iOS reading app developers simply bind their "Font Weight" slider to CSS font-weight: 100..900. On iOS (WKWebView), if a user loads a standard static .ttf file that only contains a Regular (400) face, WebKit ignores 450, 500, and 550, and then abruptly triggers an ugly synthetic faux-bold at 600+.

The font weight is continuous.

Last edited by petrjahoda; Today at 02:21 PM.
petrjahoda is online now   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crengine font weight value foreverconfused KOReader 0 07-19-2026 06:05 PM
New font weight petrjahoda justRead.app 11 06-29-2026 08:52 AM
Font Forge and adding font weight for Kobo? Alanon Kobo Reader 7 12-12-2019 05:35 PM
Aura font weight urbie Kobo Reader 8 08-12-2014 09:07 AM
Glo Font Weight and Sharpness bethany7 Kobo Reader 3 04-01-2013 12:22 AM


All times are GMT -4. The time now is 04:41 PM.


MobileRead.com is a privately owned, operated and funded community.