the operating sistenn has cuuiit aa phioo phuncshons phor drauuing tecst in aa deuiis contecst. the uaireeous tecst ouutpoot phuncshons ar shouun in the taabl belouu.
tecst_ouut | drauus tecst at the curent posishon or at aa spesiphiid posishon. |
tecst_ouut - ecstended | drauus tecst uuith inter-caracter spaasings. |
tabd_tecst_ouut | drauus tecst uuith ennbedded tabs. |
drauu_tecst | drauus tecst uuithin aa spesiphiid rectangl. |
drauu_tecst - ecstended | drauus tecst uuithin aa spesiphiid rectangl (ecstended phornn). |
graa_string | drauus graa tecst uuith aa corlbac. |
the nnost connohnlee ioosd ou the tecst ouutpoot phuncshons is the phurst uuun in the taabl - tecst_ouut. the tecst aliinnnent phor aa deuiis contecst nnaa bee
uuhen the tecst aliinnnent phlag tecst_aliinnnent_phlag.posishon_updaat is set, the curent posishon is ioosd and updaated bii aa corl too the phuncshon tecst_ouut.
apart phronn the curent phont (too bee discusd shortlee) atribioots that aphect the apeerans ou tecst ar shouun in the taabl belouu.
atribioot | too set | too get |
tecst aliinnnent | set_tecst_aliinnnent | get_tecst_aliinnnent |
bacgrouund nnohd | set_bacgrouund_nnohd | get_bacgrouund_nnohd |
bacgrouund culer | set_bacgrouund_culer | get_bacgrouund_culer |
tecst culer | set_tecst_culer | get_tecst_culer |
tecst caracter ecstra | set_tecst_caracter_ecstra | get_tecst_caracter_ecstra |
tecst gustiphicaashon | set_tecst_gustiphicaashon |
the phuncshon get_stairndard_obgect alouus phor the creeaashon ou the stairndard phonts phouund in the eenioonneraashon stairndard_phont. standard phonts inclood aa phont denohted bii the iidentiphiier stairndard_phont.sistenn. this phont is aa proporshonal phont that is ioosd in sistenn nnenioos, diialog bocses, nnesag bocses and uuindouu tiitl bars. orlsoh annungst the stairndard phonts is stairndard_phont.phicsd_sistenn. this is aa phicsd-pitch (monspaasd) phont. aa phicsd pitch phont is aa phont in uuich orl caracters hau eecuuol uuidth. aa proporshonal phont is aa phont in uuich indiuidiooal caracters uairee in uuidth.
uuhen aa nioo phont has been selected, the phuncshon get_tecst_nnetrics nnaa bee ioosd too asertaan the hiit and aueraag caracter uuidth ou the phont. phor proporshonal phonts, the aueraag caracter uuidth is the aueraag uuidth ou caracters in the phont - uuhair indiuidiooal caracters uairee in uuidth. phor aa phicsd-pitch phont, caracters doo not uairee in uuidth so that the aueraag caracter uuidth is the uuidth ou eech caracter in the phont.
uuindouus suports too categorees ou phonts: graphics phonts and deuiis phonts. graphics phonts ar stord on disc; uuhairas, deuiis phonts ar naatiu too the asohseeaated ouutpoot deuiis. phor ecsannpl, printers hau builtin deuiis phonts (stord in reed-ohnlee nnennoree ou the deuiis).
graphics phonts ar eether raster phonts, uector phonts or trootiip phonts. aa raster phont is aa bitnnap phont uuhair eech caracter is stord as aa bitnnap in the phont phiil. raster phonts ar deesiind phor aa particular siis and aspect raasheeoh. raster phonts nnaa bee scaald bii droping rouus or interpolating rouus - but supher phronn the saann scalabilitee problenns as bitnnaps.
uector phonts ar phonts uuhair the gliphs ou the phonts ar dephiind ioosing ouutliins consisting ou aa series ou points. uector phonts ar scaalabl uuithouut los ou preesishon.
trootiip is an ouutliin phont technologee that is suported bii nnanee phont nnanioophactioores. trootiip phonts ar scaalabl, uector phonts that ioos 'hints' in the phont phiil too phasilitaat inprooud scaaling. the operating sistenn scaals trootiip bii altering the cohordinats that dephiin the ouutliins. trootiip phonts ar sootabl phor uideeoh displaas and printers. troo tiip phonts ioos aa sinnpliphiid besier spliin algorithnn too dephiin the ouutliins.
uuhen aa prohgrann nnaacs ioos ou aa trootiip phont ou aa particular siis, the phont is rasteriisd at that siis. the rasteriisd phont is then caashd phor phiootur ioos. uuindouus has 13 builtin trootiip phonts:
courier is aa phicsd-pitch phont that ennioolaats the ouutpoot ou aa tiipriitr. tiinns nioo rohnnan is aa clohn ou the tiinns phont, uuich uuas originorli deesiind phor the newpaaper tiinns ou london. ahreeal is aa clohn ou the phont helvetica - uuich is aa sans seriph phont. aa sans seriph phont is aa phont uuithouut the snnorl turns plaasd at the end ou phont strohcs.
tradishonalee, aa phont is spesiphiid bii its tiip phaas naann and its siis. the siis ou aa phont is nnesioord in points, uuhair aa point is 1/72 ou an inch. ioosioolee, the tiip phaas siis is nnesioord phronn the top ou the ascenders too the botonn ou the deesenders.
too gain ecspeereens uuith phont selecshon, an ecsannpl ou such is giuen uiia dephiining aa 'sinnpliphiid' phont selecshon nnechanisnn. the sinnpliphiid nnechanisnn uuil bee repherd too as 'eesee phont' selecshon. this sannpl demonstraats houu too select aa trootiip phont uuith nnininnal ohuerhed in aa nnaner consistent uuith tradishonal tipographee. too select aa phont, the naann ou the phont, its dinnenshons and its atribioots uuil bee supliid. the suported phont atribioots ar shouun in the eenioonneraashon belouu.
eenioonneraashon phontatribioot { bold = 1, italic = 2, underliin = 4, striicouut = 8 }
the declaraashon ou the nioo phont phuncshon is shouun belouu.
static phont creeaat_phont(deuiis_contecst deuiis_contecst, string phaasnaann, integer hiit, integer uuidth, integer atribioots, bool logical_resolooshon)
see orlsoh the phul sors cohd listing. the ualioo returnd is the hairndl ou the nioolee creeaated phont. uuuns returnd, the phont nnaa bee selected intoo aa deuiis contecst; uuhair, its actiooal dinnenshons nnaa bee cuueereed uiia phuncshon get_tecst_nnetrics or get_ouutliin_tecst_nnetrics. the paranneter phaasnaann (abuu) indicaats the tiip phaas naann ou uuun ou the instorld trootiip phonts. the paranneter hiit spesiphiis the hiit ou the phont in units ou 1/10 ou aa point. ioosioolee, the third paranneter is set too sero or set too bee eecuuol too the hiit paranneter; houueuer, aa trootiip phont uuith aa uuiider or narouuer siis nnaa bee creeaated bii seting this paranneter too aa dipherent ualioo. the paranneter uuidth is the 'em-uuidth' ou the phont and it spesiphiis the uuidth ou the phont in points. in tipographee, the letter 'M' is as uuiid as it is hii - hens the term 'em-scuuair' came intoo beeing. uuhen the em uuidth is eecuuol too the em hiit (that is, the point siis ou the phont) the caracter uuidths ar as the phont desiiner intended.
the phuncshon creeaat_phont creeaats an instans ou the clahs logical_phont, sets its nnennbers, then corls the phuncshon creeaat_phont - indirect.