From 6aa1d975e0a0d440cd2ea81587df10ec7f3179c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yao=20Wei=20=28=E9=AD=8F=E9=8A=98=E5=BB=B7=29?= Date: Sat, 19 Jun 2021 20:53:24 +0800 Subject: [PATCH] use en_US to decide metrics --- src/render/context.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/render/context.rs b/src/render/context.rs index 164f5729..3112e9ae 100644 --- a/src/render/context.rs +++ b/src/render/context.rs @@ -87,7 +87,9 @@ struct FontMetrix { impl FontMetrix { pub fn new(pango_context: pango::Context, line_space: i32) -> Self { - let font_metrics = pango_context.get_metrics(None, None).unwrap(); + let font_metrics = pango_context + .get_metrics(None, Some(&pango::Language::from_string("en_US"))) + .unwrap(); let font_desc = pango_context.get_font_description().unwrap(); FontMetrix {