Google Cloud Document Ai V1 Client - Class StyleInfo (2.0.0)

Reference documentation and code samples for the Google Cloud Document Ai V1 Client class StyleInfo.

Font and other text style attributes.

Generated from protobuf message google.cloud.documentai.v1.Document.Page.Token.StyleInfo

Namespace

Google \ Cloud \ DocumentAI \ V1 \ Document \ Page \ Token

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ font_size int

Font size in points (1 point is ¹⁄₇₂ inches).

↳ pixel_font_size float

Font size in pixels, equal to unrounded font_size * resolution ÷ 72.0.

↳ letter_spacing float

Letter spacing in points.

↳ font_type string

Name or style of the font.

↳ bold bool

Whether the text is bold (equivalent to font_weight is at least 700).

↳ italic bool

Whether the text is italic.

↳ underlined bool

Whether the text is underlined.

↳ strikeout bool

Whether the text is strikethrough. This feature is not supported yet.

↳ subscript bool

Whether the text is a subscript. This feature is not supported yet.

↳ superscript bool

Whether the text is a superscript. This feature is not supported yet.

↳ smallcaps bool

Whether the text is in small caps. This feature is not supported yet.

↳ font_weight int

TrueType weight on a scale 100 (thin) to 1000 (ultra-heavy). Normal is 400, bold is 700.

↳ handwritten bool

Whether the text is handwritten.

↳ text_color Google\Type\Color

Color of the text.

↳ background_color Google\Type\Color

Color of the background.

getFontSize

Font size in points (1 point is ¹⁄₇₂ inches).

Returns
Type Description
int

setFontSize

Font size in points (1 point is ¹⁄₇₂ inches).

Parameter
Name Description
var int
Returns
Type Description
$this

getPixelFontSize

Font size in pixels, equal to unrounded font_size

  • resolution ÷ 72.0.
Returns
Type Description
float

setPixelFontSize

Font size in pixels, equal to unrounded font_size

  • resolution ÷ 72.0.
Parameter
Name Description
var float
Returns
Type Description
$this

getLetterSpacing

Letter spacing in points.

Returns
Type Description
float

setLetterSpacing

Letter spacing in points.

Parameter
Name Description
var float
Returns
Type Description
$this

getFontType

Name or style of the font.

Returns
Type Description
string

setFontType

Name or style of the font.

Parameter
Name Description
var string
Returns
Type Description
$this

getBold

Whether the text is bold (equivalent to font_weight is at least 700).

Returns
Type Description
bool

setBold

Whether the text is bold (equivalent to font_weight is at least 700).

Parameter
Name Description
var bool
Returns
Type Description
$this

getItalic

Whether the text is italic.

Returns
Type Description
bool

setItalic

Whether the text is italic.

Parameter
Name Description
var bool
Returns
Type Description
$this

getUnderlined

Whether the text is underlined.

Returns
Type Description
bool

setUnderlined

Whether the text is underlined.

Parameter
Name Description
var bool
Returns
Type Description
$this

getStrikeout

Whether the text is strikethrough. This feature is not supported yet.

Returns
Type Description
bool

setStrikeout

Whether the text is strikethrough. This feature is not supported yet.

Parameter
Name Description
var bool
Returns
Type Description
$this

getSubscript

Whether the text is a subscript. This feature is not supported yet.

Returns
Type Description
bool

setSubscript

Whether the text is a subscript. This feature is not supported yet.

Parameter
Name Description
var bool
Returns
Type Description
$this

getSuperscript

Whether the text is a superscript. This feature is not supported yet.

Returns
Type Description
bool

setSuperscript

Whether the text is a superscript. This feature is not supported yet.

Parameter
Name Description
var bool
Returns
Type Description
$this

getSmallcaps

Whether the text is in small caps. This feature is not supported yet.

Returns
Type Description
bool

setSmallcaps

Whether the text is in small caps. This feature is not supported yet.

Parameter
Name Description
var bool
Returns
Type Description
$this

getFontWeight

TrueType weight on a scale 100 (thin) to 1000 (ultra-heavy).

Normal is 400, bold is 700.

Returns
Type Description
int

setFontWeight

TrueType weight on a scale 100 (thin) to 1000 (ultra-heavy).

Normal is 400, bold is 700.

Parameter
Name Description
var int
Returns
Type Description
$this

getHandwritten

Whether the text is handwritten.

Returns
Type Description
bool

setHandwritten

Whether the text is handwritten.

Parameter
Name Description
var bool
Returns
Type Description
$this

getTextColor

Color of the text.

Returns
Type Description
Google\Type\Color|null

hasTextColor

clearTextColor

setTextColor

Color of the text.

Parameter
Name Description
var Google\Type\Color
Returns
Type Description
$this

getBackgroundColor

Color of the background.

Returns
Type Description
Google\Type\Color|null

hasBackgroundColor

clearBackgroundColor

setBackgroundColor

Color of the background.

Parameter
Name Description
var Google\Type\Color
Returns
Type Description
$this