font

Purpose

Finds documents written in a particular style.

Syntax

font(parameter[, argument])

Arguments

The function accepts single argument which is a named parameter that takes the following values:

Parameter

Value

Comments

style

normal — regular type

bold — bold type

italic — italic type

strike — strikethrough text

underline — underline

subscript — subscript

superscript — superscript

Values can be combined via underscore (“_”), e.g.: style:=bold_underline.

size

font size

size:=14

name

font name

name:="Times New Roman"

scope

text — maximum text fragment that matches the query conditions (default value)

token — a token matching the query

sentence — a sentence or its part matching the query

paragraph — a paragraph or its part matching the query

The scope parameter is only applicable if function arguments are not specified.

For example, in the query font(style:=bold, noun()) query, the scope parameter is unnecessary because the function will find the text fragment corresponding to a noun.

spacing

spacing between characters

The value is measured in points (pts) and takes the following values:

negative number - condensed spacing;

positive number - expanded spacing;

0 - no spacing;

The function works in docx format documents.

Returned Value

Documents matching the query.

Examples

font() the query finds nothing, because a named parameter must be specified for the function to work correctly.

font(style:=bold, size:=14, name:="Times New Roman") finds text that matches bold text, font Times New Roman size 14.

font(noun(), style:=bold, size:=14, name:="Times New Roman") finds bold nouns written in Times New Roman font size.

font(style:=bold_italic) finds text that is both bold and italics.

font(style:=normal_bold) an invalid query that won’t find anything, since text can’t be regular and bold at the same time.

font(style:=bold, scope:=paragraph) finds a paragraph or its part written in bold.

font(spacing:=1) finds text with 1pt spacing between characters.

font(spacing:=“-1”) finds text with condensed character spacing equal to 1pt.

font(spacing:<0) finds any text with condensed character spacing.

font(spacing:>0) finds any text with expanded character spacing.