ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Print functions
  • Default font
  • Getting the list of fonts installed on a computer
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Creates a new print font from the standard window for font selection:
This font can be used in different processes. This font is identified by a font number, chosen during the development process. To choose this font and use it in the different print functions, simply select it with iFont.
Remark: This function MUST NECESSARILY be called AFTER iPreview. Otherwise, the previews will be ignored.
Example
FontNum is int
FontNum = iSelectFont(1, True, "Arial", 8, iBold + iUnderlined, LightRed)
IF FontNum = 0 THEN
ProcessError()
END
Syntax
<Result> = iSelectFont(<Font number> [, <Advanced options> [, <Preselected font> [, <Preselected height>]]] , <Style> [, <Color>])
<Result>: Integer
  • Identifier of the selected font,
  • 0 if a failure occurred (selection canceled for example).
<Font number>: Integer
Font identifier. This identifier will be used by iFont to select a font.
<Advanced options>: Optional boolean
  • True (default option): enables the display for the underlined attribute and for the choice of colors.
  • False: ignores the advanced options.
<Preselected font>: Optional character string
Name of the font selected by default in the font selection window. No font is pre-selected if this parameter is not specified.
<Preselected height>: Optional integer
Height of the font selected by default in the font selection window. No height is selected by default if this parameter is not specified.
<Style>: Integer constant (or combination of constants)
Font attributes:
iBoldBold font
iCondensedCondensed characters
iExtendedExtended characters
iItalicItalic font
iLargeLarge characters
iNormal
(default value)
Standard font, without attributes
iStrikeOutStrikethrough font
iUnderlinedUnderlined font
<Color>: Optional integer
Color used for the font. If this parameter is not specified, the color used is black.
This color can correspond to:
Remarks

Default font

The default font has the following characteristics:
  • Font #0,
  • Size: 12,
  • Normal style.

Getting the list of fonts installed on a computer

To get the list fonts installed on a computer:
  1. In the program manager of Windows, choose the main group.
  2. Click the "Control panel" icon and select "Fonts".
  3. In the list of fonts installed, write down the names without taking the attributes and the types into account.
Remarks:
  • FontList returns the list of fonts installed on a computer.
  • iSelectFont creates a print font from the standard Windows font selection window.

Miscellaneous

  • iCreateFont can also be used to create fonts.
  • You must create as many fonts as the number of colors found in the text.
Component: wd300prn.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
exemplo iSelectFont
// exemplo iSelectFont

nFonte_Numero is int=iSelectFont(1,True,"Arial",8,iBold,LightGray)
iDestination(iPDF)
Marca_Dagua()
iPrint(iFont(1) + "")
iPrint("")
iPrint("Relatorio de Bancos")
iHLine(0, iPageWidth())
iPrint("")
iPrint(iXPos(1) + "Codigo" + iXPos(18) +"Nome")
iHLine(0, 30)
iPrint("")
FOR EACH bancos
iPrint(iXPos(1)+ NumToString(bancos.id_bancos,"06d") + iXPos(18) + bancos.nome)
END
iHLine(0, iPageWidth(), 2.5)
iPrint("")
iPrint("Tipos Linhas - iDotted")
iHLine(0, 30,iDotted)
iPrint("")
iPrint("iDotAndDash")
iHLine(0, 40,iDotAndDash)
iPrint("")
iPrint("iDashed")
iHLine(0, 50,iDashed)
iEndPrinting()
ShellExecute(iLastFile())

INTERNAL PROCEDURE Marca_Dagua()
Marca_Dagua is Watermark
Marca_Dagua..Text = "Homologação"
Marca_Dagua..Font..Name = "Arial"
Marca_Dagua..Position = iCenterH + iBottom
Marca_Dagua..Opacity=50
iParameterWatermark(iWatermarkPrinting + iWatermarkDuplicate, Marca_Dagua)
END

// Blog com Video e Exemplo

http://windevdesenvolvimento.blogspot.com.br/2016/11/aula-978-windev-relatorio-37-iselectfont.html

https://www.youtube.com/watch?v=7GYnraTyzCw

De matos
04 Dec. 2016

Last update: 09/06/2023

Send a report | Local help