Aller au contenu principal
Version: 20 R5

VP Object to font

VP Object to font ( fontObj : Object ) : Text

ParamètresTypeDescription
fontObjObject->Objet police
RésultatText<-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éTypeDescriptionValeurs possiblesObligatoire
familytextDéfinit la police.tout type de famille de police standard ou générique. Ex : Ex : Ex : "Arial", "Helvetica", "serif", "arial,sans-serif"Oui
sizetextDé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 :
  • "em", "ex", "%", "px", "cm", "mm", "in", "pt", "pc", "ch", "rem", "vh", "vw", "vmin", "vmax"
  • ou l'une des constantes suivantes :
  • vk font size large
  • vk font size larger
  • vk font size x large
  • vk font size xx large
  • vk font size small
  • vk font size smaller
  • vk font size x small
  • vk font size xx small
  • Oui
    styletextStyle de police.
  • vk font style italic
  • vk font style oblique
  • Non
    varianttextPolice en petites majuscules.
  • vk font variant small caps
  • Non
    weighttextDéfinit l'épaisseur de la police.
  • vk font weight 100
  • vk font weight 200
  • vk font weight 300
  • vk font weight 400
  • vk font weight 500
  • vk font weight 600
  • vk font weight 700
  • vk font weight 800
  • vk font weight 900
  • vk font weight bold
  • vk font weight bolder
  • vk 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