#include "ui/gfx/text_utils.h"
#include <stdint.h>
#include "base/i18n/char_iterator.h"
#include "base/i18n/rtl.h"
#include "base/numerics/safe_conversions.h"
#include "third_party/icu/source/common/unicode/uchar.h"
#include "third_party/icu/source/common/unicode/utf16.h"
#include "ui/gfx/font_list.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
namespace gfx {
UTF16CharIterator;
namespace {
constexpr char16_t kAcceleratorChar = …;
constexpr char16_t kOpenParenthesisChar = …;
constexpr char16_t kCloseParenthesisChar = …;
bool IsCombiningMark(UChar32 c) { … }
bool IsSpace(UChar32 c) { … }
std::u16string RemoveAcceleratorChar(bool full_removal,
const std::u16string& s,
int* accelerated_char_pos,
int* accelerated_char_span) { … }
}
std::u16string LocateAndRemoveAcceleratorChar(const std::u16string& s,
int* accelerated_char_pos,
int* accelerated_char_span) { … }
std::u16string RemoveAccelerator(const std::u16string& s) { … }
size_t FindValidBoundaryBefore(const std::u16string& text,
size_t index,
bool trim_whitespace) { … }
size_t FindValidBoundaryAfter(const std::u16string& text,
size_t index,
bool trim_whitespace) { … }
HorizontalAlignment MaybeFlipForRTL(HorizontalAlignment alignment) { … }
Size GetStringSize(const std::u16string& text, const FontList& font_list) { … }
Insets AdjustVisualBorderForFont(const FontList& font_list,
const Insets& desired_visual_padding) { … }
int GetFontCapHeightCenterOffset(const gfx::FontList& original_font,
const gfx::FontList& to_center) { … }
}