VP Object to font
VP Object to font ( fontObj : Object ) : Text
| Parâmetro | Tipo | Descrição | ||
|---|---|---|---|---|
| fontObj | Object | -> | Objecto letra | |
| Resultados | Text | <- | Fonte abreviada |
Descrição
O comando VP Object to font retorna uma string abreviada de fonte de fontObj.
Em fontObj, passe um objeto que contém as propriedades da fonte. As propriedades abaixo são compatíveis:
| Propriedade | Tipo | Descrição | Valores possíveis | Obrigatório |
|---|---|---|---|---|
| family | text | Especifica o tipo de letra. | qualquer família de tipos de letra padrão ou genérica. Ex. Ex. Ex. "Arial", "Helvetica", "serif", "arial,sans-serif" | Sim |
| size | text | Define o tamanho da fonte. A linha-altura pode ser adicionada ao tamanho da fonte: font-size/line-height: Ex: "15pt/20pt" | um número com uma das seguintes unidades: vk font size largevk font size largervk font size x largevk font size xx largevk font size smallvk font size smallervk font size x smallvk font size xx small | Sim |
| style | text | O estilo do tipo de letra. | vk font style italicvk font style oblique | Não |
| variant | text | Especifica o tipo de letra em pequenas maiúsculas. | vk font variant small caps | Não |
| weight | text | Define a espessura do tipo de letra. | vk font weight 100vk font weight 200vk font weight 300vk font weight 400vk font weight 500vk font weight 600vk font weight 700vk font weight 800vk font weight 900vk font weight boldvk font weight boldervk font weight lighter | Não |
Esse objeto pode ser criado com o comando VP Font to object.
A cadeia de caracteres abreviada retornada pode ser atribuída à propriedade "font" de uma célula com o comando VP SET CELL STYLE, por exemplo.
Exemplo
$cellStyle:=VP Get cell style($range)
$font:=VP Font to object($cellStyle.font)
$font.style:=vk font style oblique
$font.variant:=vk font variant small caps
$font.weight:=vk font weight bolder
$cellStyle.font:=VP Object to font($font)
//$cellStyle.font contém "bolder oblique small-caps 16pt arial"
Veja também
4D View Pro Style Objects and Style Sheets
VP Font to object
VP SET CELL STYLE
VP SET DEFAULT STYLE