Skia
2D Graphics Library
SkFontArguments.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkFontArguments_DEFINED
9 #define SkFontArguments_DEFINED
10 
11 #include "include/core/SkScalar.h"
12 #include "include/core/SkTypes.h"
13 
17  struct Coordinate {
19  float value;
20  };
23  };
24 
25  SkFontArguments() : fCollectionIndex(0), fVariationDesignPosition{nullptr, 0} {}
26 
32  SkFontArguments& setCollectionIndex(int collectionIndex) {
33  fCollectionIndex = collectionIndex;
34  return *this;
35  }
36 
45  fVariationDesignPosition.coordinates = position.coordinates;
46  fVariationDesignPosition.coordinateCount = position.coordinateCount;
47  return *this;
48  }
49 
50  int getCollectionIndex() const {
51  return fCollectionIndex;
52  }
53 
55  return fVariationDesignPosition;
56  }
57 private:
58  int fCollectionIndex;
59  VariationPosition fVariationDesignPosition;
60 };
61 
62 #endif
SkFontArguments::setVariationDesignPosition
SkFontArguments & setVariationDesignPosition(VariationPosition position)
Specify a position in the variation design space.
Definition: SkFontArguments.h:44
SkFontArguments::VariationPosition::coordinateCount
int coordinateCount
Definition: SkFontArguments.h:22
SkTypes.h
SkFontArguments::VariationPosition
Definition: SkFontArguments.h:16
SkFontArguments::VariationPosition::Coordinate
Definition: SkFontArguments.h:17
SkScalar.h
SkFontArguments::SkFontArguments
SkFontArguments()
Definition: SkFontArguments.h:25
SkFontArguments::setCollectionIndex
SkFontArguments & setCollectionIndex(int collectionIndex)
Specify the index of the desired font.
Definition: SkFontArguments.h:32
SkFourByteTag
uint32_t SkFourByteTag
Definition: SkTypes.h:543
SkFontArguments::getCollectionIndex
int getCollectionIndex() const
Definition: SkFontArguments.h:50
SkFontArguments::VariationPosition::Coordinate::axis
SkFourByteTag axis
Definition: SkFontArguments.h:18
SkFontArguments::VariationPosition::Coordinate::value
float value
Definition: SkFontArguments.h:19
SkFontArguments::getVariationDesignPosition
VariationPosition getVariationDesignPosition() const
Definition: SkFontArguments.h:54
SkFontArguments::VariationPosition::coordinates
const Coordinate * coordinates
Definition: SkFontArguments.h:21
SkFontArguments
Represents a set of actual arguments for a font.
Definition: SkFontArguments.h:15