[evince/BUG_ℕ_copied_as_N] keep same visual appearance between displayed and copied text
- From: Nelson Ben <nbenitez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/BUG_ℕ_copied_as_N] keep same visual appearance between displayed and copied text
- Date: Fri, 12 Feb 2021 15:24:05 +0000 (UTC)
commit 08f54ef41573b3c2ba837667e27e081ed3cef952
Author: Nelson Benítez León <nbenitezl gmail com>
Date: Fri Feb 12 01:25:16 2021 -0400
keep same visual appearance between displayed and copied text
When copying text from displayed document to the clipboard,
we want a normalization that preserves 'canonical equivalence'
i.e. that the text after normalization is not visually
different than the original text. Our previous normalization
was just preserving unicode 'compatibility'.
Relevant documentation:
* https://www.win.tue.nl/~aeb/linux/uc/nfc_vs_nfd.html
* https://en.wikipedia.org/wiki/Unicode_equivalence
* https://developer.gnome.org/glib/stable/glib-Unicode-Manipulation.html#g-utf8-normalize
Issue #1085
libview/ev-view.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 17a30b93..dab6a7ae 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -10111,7 +10111,10 @@ get_selected_text (EvView *view)
ev_document_doc_mutex_unlock ();
- normalized_text = g_utf8_normalize (text->str, text->len, G_NORMALIZE_NFKC);
+ /* For copying text from the document to the clipboard, we want a normalization
+ * that preserves 'canonical equivalence' i.e. that text after normalization
+ * is not visually different than the original text. Issue #1085 */
+ normalized_text = g_utf8_normalize (text->str, text->len, G_NORMALIZE_NFC);
g_string_free (text, TRUE);
return normalized_text;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]