MyScript Interactive Ink SDK  4.1.2
IFontMetricsProvider.h
1 // Copyright @ MyScript. All rights reserved.
2 
3 #pragma once
4 
5 #include <string>
6 #include <vector>
7 
8 #include <iink/text/TextSpan.h>
9 #include <iink/text/Text.h>
10 #include <iink/graphics/Rectangle.h>
11 #include <iink/graphics/Style.h>
12 
13 namespace myscript {
14 namespace iink {
15 namespace text {
16 
21 {
25 };
26 
27 
32 {
33 public:
34 
35  virtual ~IFontMetricsProvider() = default;
36 
45  virtual std::vector<myscript::iink::graphics::Rectangle> getCharacterBoundingBoxes(std::shared_ptr<Text> text, const std::vector<TextSpan>& spans) = 0;
46 
54  virtual float getFontSizePx(const myscript::iink::graphics::Style& style) = 0;
55 
63  virtual bool supportsGlyphMetrics() { return false; }
64 
70  virtual std::vector<GlyphMetrics> getGlyphMetrics(std::shared_ptr<Text> text, const std::vector<TextSpan>& spans) { return {}; }
71 };
72 
73 } // text
74 } // iink
75 } // myscript
Definition: Style.h:23
Definition: IFontMetricsProvider.h:32
virtual std::vector< GlyphMetrics > getGlyphMetrics(std::shared_ptr< Text > text, const std::vector< TextSpan > &spans)
Definition: IFontMetricsProvider.h:70
virtual bool supportsGlyphMetrics()
Definition: IFontMetricsProvider.h:63
virtual std::vector< myscript::iink::graphics::Rectangle > getCharacterBoundingBoxes(std::shared_ptr< Text > text, const std::vector< TextSpan > &spans)=0
virtual float getFontSizePx(const myscript::iink::graphics::Style &style)=0
Definition: Configuration.h:10
Definition: Rectangle.h:17
Definition: IFontMetricsProvider.h:21
float rightSideBearing
Definition: IFontMetricsProvider.h:24
float leftSideBearing
Definition: IFontMetricsProvider.h:23
graphics::Rectangle boundingBox
Definition: IFontMetricsProvider.h:22