diff options
author | bptato <nincsnevem662@gmail.com> | 2025-02-15 16:55:28 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2025-02-15 16:55:28 +0100 |
commit | 5578fda7acbc5ef87a4efad0cbf07cb840f3f11d (patch) | |
tree | 45134c5e0f8a9d16938a5a9ae5b1395586b5ab55 /src | |
parent | 79d2518ca49f19da479e88a4eb35d73725fe71d8 (diff) | |
download | chawan-5578fda7acbc5ef87a4efad0cbf07cb840f3f11d.tar.gz |
layout: skip Cf characters
We cannot handle these yet.
Diffstat (limited to 'src')
-rw-r--r-- | src/css/layout.nim | 3 | ||||
-rw-r--r-- | src/utils/luwrap.nim | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/css/layout.nim b/src/css/layout.nim index 2a4e33b8..c2facdd3 100644 --- a/src/css/layout.nim +++ b/src/css/layout.nim @@ -1007,7 +1007,8 @@ proc layoutTextLoop(fstate: var FlowState; state: var InlineState; else: let pi = i let u = str.nextUTF8(i) - if luctx.isEnclosingMark(u) or luctx.isNonspacingMark(u): + if luctx.isEnclosingMark(u) or luctx.isNonspacingMark(u) or + luctx.isFormat(u): continue let w = u.width() fstate.checkWrap(state, u, w) diff --git a/src/utils/luwrap.nim b/src/utils/luwrap.nim index e2748958..b22cdb0d 100644 --- a/src/utils/luwrap.nim +++ b/src/utils/luwrap.nim @@ -87,6 +87,7 @@ type lurHangul = "Hangul" lurEnclosingMark = "Me" lurNonspacingMark = "Mn" + lurFormat = "Cf" LUContextObj = object crs: array[LURangeType, CharRange] @@ -149,3 +150,7 @@ proc isEnclosingMark*(ctx: LUContext; u: uint32): bool = proc isNonspacingMark*(ctx: LUContext; u: uint32): bool = ctx.initGeneralCategory(lurNonspacingMark) return u in ctx.crs[lurNonspacingMark] + +proc isFormat*(ctx: LUContext; u: uint32): bool = + ctx.initGeneralCategory(lurFormat) + return u in ctx.crs[lurFormat] |