koreader / crengine

This is the KOReader CREngine fork. It cross-pollinates with the official CoolReader repository at https://github.com/buggins/coolreader, in case you were looking for that one.
70 stars 45 forks source link

Minor CSS fixes, add support for .docm #523

Closed poire-z closed 1 year ago

poire-z commented 1 year ago

DocX: add support for similar DocM format

https://github.com/koreader/koreader/issues/10599#issuecomment-1627678171. Thanks @pkb. Should allow closing https://github.com/koreader/koreader/issues/10599.

LVStyleSheet: fix LVCssDeclaration::getHash()

Computations could stop too early (when meeting the ASCII char cssd_stop, currently h, ie. in a 'url(aha.png)'), which would have any change after that h goes unnoticed. Noticed at https://github.com/koreader/crengine/issues/514#issuecomment-1616584156.

CSS parsing: accept Unicode values for ID and classnames

(We still expect ASCII for element and attribute names.) Got a French EPUB that has in its CSS (as utf8, shown here read as latin1):

section{
visibility: hidden;
}
section#mentions,
section#préface,
section#lever-de-rideau-avant-propos,
section#actepremier-en-scène-histoire,
section#remerciements { visibility: visible !important; }

which was mostly blank :) We'll now support #id and .classname made with other chars than ASCII ones. I hope it won't cause issues with other fancy CSS with other encodings.

update for Harfbuzz 8, fix some compiler warning

hb_font_get_glyph_shape() is deprecated and has been replaced with hb_font_draw_glyph().


This change is Reviewable

poire-z commented 1 year ago

@benoit-pierre @NiLuJe : no real issue, but as you are all high on build and compilers, any idea about the two errors reported by the CI - and how to silence them?

error: 'LVFontGlyphCacheItem' does not refer to a value [clang-diagnostic-error is 2 years old: https://github.com/koreader/crengine/pull/450#issuecomment-907043201

error: Reference to temporary returned. has been here since forever.

NiLuJe commented 1 year ago

IIRC, it's something related to the fact that LVFontGlyphCacheItem is not a plain struct, it's got functions like a class.

No idea about the second one (both of those look too C++-y for me ;p).

Frenzie commented 1 year ago

Some people have advocated for using emoji classnames as a joke. But it wouldn't necessarily be surprising to see other scripts in any case.