Skip to content

Commit

Permalink
Replace ’ unicode char with ' for news description
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Feb 16, 2024
1 parent 57bc038 commit 644b002
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/app/ui/news_listbox.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2020-2022 Igara Studio S.A.
// Copyright (C) 2020-2024 Igara Studio S.A.
// Copyright (C) 2001-2017 David Capello
//
// This program is distributed under the terms of
Expand Down Expand Up @@ -108,6 +108,19 @@ std::string parse_html(const std::string& str)

paraOpen = false;
}
// Replace "right single quotation mark" = "’" = 0x2019 = 0xe2
// 0x80 0x99 (utf8) with ASCII char "'", useful for news phrases
// like "What's new? ..." or "We're ..." and to avoid
// anti-aliasing (using a TTF font) as the Aseprite font doesn't
// contain this character yet.
else if (i+2 < str.size() &&
unsigned char(str[i ]) == 0xe2 &&
unsigned char(str[i+1]) == 0x80 &&
unsigned char(str[i+2]) == 0x99) {
result.push_back('\'');
i += 3;
paraOpen = false;
}
else {
result.push_back(str[i++]);
paraOpen = false;
Expand Down

0 comments on commit 644b002

Please sign in to comment.