Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30731ebe authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update Typeface test implementation not to copy minikin::Font"

parents bbd31263 99d66f06
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -182,10 +182,11 @@ void Typeface::setRobotoTypefaceForTest() {

    std::shared_ptr<minikin::MinikinFont> font = std::make_shared<MinikinFontSkia>(
            std::move(typeface), data, st.st_size, 0, std::vector<minikin::FontVariation>());
    std::shared_ptr<minikin::FontFamily> family = std::make_shared<minikin::FontFamily>(
            std::vector<minikin::Font>({minikin::Font(std::move(font), minikin::FontStyle())}));
    std::shared_ptr<minikin::FontCollection> collection =
            std::make_shared<minikin::FontCollection>(std::move(family));
    std::vector<minikin::Font> fonts;
    fonts.push_back(minikin::Font(std::move(font), minikin::FontStyle()));

    std::shared_ptr<minikin::FontCollection> collection = std::make_shared<minikin::FontCollection>(
            std::make_shared<minikin::FontFamily>(std::move(fonts)));

    Typeface* hwTypeface = new Typeface();
    hwTypeface->fFontCollection = collection;
+3 −2
Original line number Diff line number Diff line
@@ -56,8 +56,9 @@ std::shared_ptr<minikin::FontFamily> buildFamily(const char* fileName) {
    LOG_ALWAYS_FATAL_IF(typeface == nullptr, "Failed to make typeface from %s", fileName);
    std::shared_ptr<minikin::MinikinFont> font = std::make_shared<MinikinFontSkia>(
            std::move(typeface), data, st.st_size, 0, std::vector<minikin::FontVariation>());
    return std::make_shared<minikin::FontFamily>(
            std::vector<minikin::Font>({minikin::Font(std::move(font), minikin::FontStyle())}));
    std::vector<minikin::Font> fonts;
    fonts.push_back(minikin::Font(std::move(font), minikin::FontStyle()));
    return std::make_shared<minikin::FontFamily>(std::move(fonts));
}

std::vector<std::shared_ptr<minikin::FontFamily>> makeSingleFamlyVector(const char* fileName) {