mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Fix text direction info
The spec changed and has been implemented in WebKit: https://bugs.webkit.org/show_bug.cgi?id=252444 But not in Chromium yet: https://crbug.com/v8/13835
This commit is contained in:
@@ -45,7 +45,7 @@ export class View {
|
||||
const tag = typeof language === 'string' ? language : language[0]
|
||||
const locale = new Intl.Locale(tag)
|
||||
this.isCJK = ['zh', 'ja', 'kr'].includes(locale.language)
|
||||
this.textDirection = locale.textInfo.direction
|
||||
this.textDirection = (locale.getTextInfo?.() ?? locale.textInfo)?.direction
|
||||
} catch(e) {
|
||||
console.warn(e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user