VP Object to font
VP Object to font ( fontObj : Object ) : Text
| Paramètres | Type | Description | ||
|---|---|---|---|---|
| fontObj | Object | -> | Objet police | |
| Résultat | Text | <- | Police raccourcie (shorthand) |
Description
La commande VP Object to font retourne une chaîne de raccourci de police de fontObj.
Dans fontObj, passez un objet contenant les propriétés de police. Les propriétés suivantes sont prises en charge :
| Propriété | Type | Description | Valeurs possibles | Obligatoire |
|---|---|---|---|---|
| family | text | Définit la police. | tout type de famille de police standard ou générique. Ex : Ex : Ex : "Arial", "Helvetica", "serif", "arial,sans-serif" | Oui |
| size | text | Définit la taille de la police. Le line-height peut être ajouté au font-size : font-size/line-height : Ex : "15pt/20pt" | un nombre avec l'une des unités suivantes : 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 | Oui |
| style | text | Style de police. | vk font style italicvk font style oblique | Non |
| variant | text | Police en petites majuscules. | vk font variant small caps | Non |
| weight | text | Définit l'épaisseur de la police. | 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 | Non |
Cet objet peut être créé à l'aide de la commande VP Font to object.
La chaîne raccourcie retournée peut être affectée à la propriété "font" d'une cellule avec VP SET CELL STYLE, par exemple.
Exemple
$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 contient "bolder oblique small-caps 16pt arial"
Voir également
4D View Pro Style Objects and Style Sheets
VP Font to object
VP SET CELL STYLE
VP SET DEFAULT STYLE