font_fallback.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef UI_GFX_FONT_FALLBACK_H_
  5. #define UI_GFX_FONT_FALLBACK_H_
  6. #include <string>
  7. #include <vector>
  8. #include "base/strings/string_piece_forward.h"
  9. #include "build/build_config.h"
  10. #include "ui/gfx/font.h"
  11. #include "ui/gfx/gfx_export.h"
  12. namespace gfx {
  13. class Font;
  14. // Given a font, returns the fonts that are suitable for fallback.
  15. GFX_EXPORT std::vector<Font> GetFallbackFonts(const Font& font);
  16. // Finds a fallback font to render the specified |text| with respect to an
  17. // initial |font|. Returns the resulting font via out param |result|. Returns
  18. // |true| if a fallback font was found.
  19. bool GFX_EXPORT GetFallbackFont(const Font& font,
  20. const std::string& locale,
  21. base::StringPiece16 text,
  22. Font* result);
  23. } // namespace gfx
  24. #endif // UI_GFX_FONT_FALLBACK_H_