@@ -63,14 +63,14 @@ public:
|
||||
int CountRuns() const override;
|
||||
const ParagraphLayouter::VisualRun &GetVisualRun(int run) const override;
|
||||
|
||||
int GetInternalCharLength(WChar c) const override { return 1; }
|
||||
int GetInternalCharLength(char32_t c) const override { return 1; }
|
||||
};
|
||||
|
||||
const WChar *buffer_begin; ///< Begin of the buffer.
|
||||
const WChar *buffer; ///< The current location in the buffer.
|
||||
FontMap &runs; ///< The fonts we have to use for this paragraph.
|
||||
const char32_t *buffer_begin; ///< Begin of the buffer.
|
||||
const char32_t *buffer; ///< The current location in the buffer.
|
||||
FontMap &runs; ///< The fonts we have to use for this paragraph.
|
||||
|
||||
FallbackParagraphLayout(WChar *buffer, int length, FontMap &runs);
|
||||
FallbackParagraphLayout(char32_t *buffer, int length, FontMap &runs);
|
||||
void Reflow() override;
|
||||
std::unique_ptr<const Line> NextLine(int max_width) override;
|
||||
};
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
* @param fontMapping THe mapping of the fonts.
|
||||
* @return The ParagraphLayout instance.
|
||||
*/
|
||||
/* static */ ParagraphLayouter *FallbackParagraphLayoutFactory::GetParagraphLayout(WChar *buff, WChar *buff_end, FontMap &fontMapping)
|
||||
/* static */ ParagraphLayouter *FallbackParagraphLayoutFactory::GetParagraphLayout(char32_t *buff, char32_t *buff_end, FontMap &fontMapping)
|
||||
{
|
||||
return new FallbackParagraphLayout(buff, buff_end - buff, fontMapping);
|
||||
}
|
||||
@@ -190,7 +190,7 @@ const ParagraphLayouter::VisualRun &FallbackParagraphLayout::FallbackLine::GetVi
|
||||
* @param length The length of the paragraph.
|
||||
* @param runs The font mapping of this paragraph.
|
||||
*/
|
||||
FallbackParagraphLayout::FallbackParagraphLayout(WChar *buffer, int length, FontMap &runs) : buffer_begin(buffer), buffer(buffer), runs(runs)
|
||||
FallbackParagraphLayout::FallbackParagraphLayout(char32_t *buffer, int length, FontMap &runs) : buffer_begin(buffer), buffer(buffer), runs(runs)
|
||||
{
|
||||
assert(runs.rbegin()->first == length);
|
||||
}
|
||||
@@ -233,14 +233,14 @@ std::unique_ptr<const ParagraphLayouter::Line> FallbackParagraphLayout::NextLine
|
||||
}
|
||||
|
||||
const FontCache *fc = iter->second->fc;
|
||||
const WChar *next_run = this->buffer_begin + iter->first;
|
||||
const char32_t *next_run = this->buffer_begin + iter->first;
|
||||
|
||||
const WChar *begin = this->buffer;
|
||||
const WChar *last_space = nullptr;
|
||||
const WChar *last_char;
|
||||
const char32_t *begin = this->buffer;
|
||||
const char32_t *last_space = nullptr;
|
||||
const char32_t *last_char;
|
||||
int width = 0;
|
||||
for (;;) {
|
||||
WChar c = *this->buffer;
|
||||
char32_t c = *this->buffer;
|
||||
last_char = this->buffer;
|
||||
|
||||
if (c == '\0') {
|
||||
|
Reference in New Issue
Block a user