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

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
NameDescription
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.

↳ subscript bool

Whether the text is a subscript.

↳ superscript bool

Whether the text is a superscript.

↳ smallcaps bool

Whether the text is in small caps.

↳ 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
TypeDescription
int

setFontSize

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

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getPixelFontSize

Font size in pixels, equal to unrounded font_size

  • resolution ÷ 72.0.
Returns
TypeDescription
float

setPixelFontSize

Font size in pixels, equal to unrounded font_size

  • resolution ÷ 72.0.
Parameter
NameDescription
var float
Returns
TypeDescription
$this

getLetterSpacing

Letter spacing in points.

Returns
TypeDescription
float

setLetterSpacing

Letter spacing in points.

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getFontType

Name or style of the font.

Returns
TypeDescription
string

setFontType

Name or style of the font.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getBold

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

Returns
TypeDescription
bool

setBold

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

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getItalic

Whether the text is italic.

Returns
TypeDescription
bool

setItalic

Whether the text is italic.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getUnderlined

Whether the text is underlined.

Returns
TypeDescription
bool

setUnderlined

Whether the text is underlined.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getStrikeout

Whether the text is strikethrough.

Returns
TypeDescription
bool

setStrikeout

Whether the text is strikethrough.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getSubscript

Whether the text is a subscript.

Returns
TypeDescription
bool

setSubscript

Whether the text is a subscript.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getSuperscript

Whether the text is a superscript.

Returns
TypeDescription
bool

setSuperscript

Whether the text is a superscript.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getSmallcaps

Whether the text is in small caps.

Returns
TypeDescription
bool

setSmallcaps

Whether the text is in small caps.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getFontWeight

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

Normal is 400, bold is 700.

Returns
TypeDescription
int

setFontWeight

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

Normal is 400, bold is 700.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getHandwritten

Whether the text is handwritten.

Returns
TypeDescription
bool

setHandwritten

Whether the text is handwritten.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getTextColor

Color of the text.

Returns
TypeDescription
Google\Type\Color|null

hasTextColor

clearTextColor

setTextColor

Color of the text.

Parameter
NameDescription
var Google\Type\Color
Returns
TypeDescription
$this

getBackgroundColor

Color of the background.

Returns
TypeDescription
Google\Type\Color|null

hasBackgroundColor

clearBackgroundColor

setBackgroundColor

Color of the background.

Parameter
NameDescription
var Google\Type\Color
Returns
TypeDescription
$this