Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th May 2023, 14:19   #1  |  Link
cancandodo
Registered User
 
Join Date: Aug 2011
Posts: 1
Subtitle Code in Avisynth will output Bold Font defualt,how to output unbold font?

Subtitle Code in Avisynth will output Bold Font defualt,how to output unbold font?


Cilp.Subtitle("Hello", font="Arial",first_frame=0, last_frame=999, x=0,y=0,size=72, text_color=$FFFFFF, lsp=0)

this codes output Text will be show as Bold fonts defualt
i don't know how to change to unbold font?
cancandodo is offline   Reply With Quote
Old 1st June 2023, 17:34   #2  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,333
It should be font="Arial Regular", but result looks like Courier to me

font="Arial Black", font="Arial Italic" , font="Arial Bold Italic" all work, but not "Arial Regular" for some reason. Not sure why
poisondeathray is offline   Reply With Quote
Old 4th June 2023, 02:23   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,957
Quote:
but not "Arial Regular" for some reason.
Not far off PDR
Code:
BlankClip()
Subtitle("Hellow World",Font = "Arial",Size=64)
Subtitle("Hellow World",Font = "Arial-Regular",Size=64,Y=80)


EDIT: NO, that aint right either, change to eg "Arial-RegularZZZZZZ" and same result.
(I looked it up in google and somewhere it said "Arial-Regular", but it aint right)

Code:
BlankClip()
Subtitle("Hellow World",Font = "Arial",Size=64)
Subtitle("Hellow World",Font = "arial bold",Size=64,Y=80)
same


Windows 10 font list:
https://learn.microsoft.com/en-us/ty...s_10_font_list
It aint there. [well not as arial regular]
Does not seem to be in XP either [some XP available fonts went missing in later years, I think].

Does not seem to be in W10 Features On Demand
https://learn.microsoft.com/en-us/wi...iew=windows-11

But there is a Downloadable version available.
https://www.dafontfree.net/arial-regular/f169067.htm

EDIT:
Damn, its there in my Control Panel Fonts whatsit, [clickMe]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 4th June 2023 at 03:06.
StainlessS is offline   Reply With Quote
Old 4th June 2023, 06:01   #4  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,410
You can't.

https://github.com/AviSynth/AviSynth...LL496C1-L496C1
Quote:
extern bool GetTextBoundingBox(const char* text, const char* fontname, int size, bool bold, bool italic, int align, int* width, int* height);
https://github.com/AviSynth/AviSynth...518C5-L518C108
Quote:
GetTextBoundingBox(message, "Arial", size, true, false, TA_TOP | TA_CENTER, &text_width, &text_height);
Now for the fun part. That second one, where the font and sizing and what-all is actually set? That part has remained untouched for nearly 20 years - and that commit on November 27th 2003 was just moving the file itself around, past which there is no commit history for source.cpp. Subtitle() has been hardcoded to only output Bold text for longer than the commit history of the file where it's defined. It may well reach back into the 2.0 or 1.x days, but the file move occurred about a week after the version was bumped to 2.5.4.
qyot27 is offline   Reply With Quote
Old 4th June 2023, 06:49   #5  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,026
As I remember in Win font rasterizing API exist also 'font weight' param - but for most of fonts it do nothing (or simply select between standard and bold). So font must support different 'weight' drawing data or rendered sets ?

From some branch of win-API docs : https://learn.microsoft.com/en-us/do...owsdesktop-7.0

A font weight describes the relative weight of a font, in terms of the lightness or heaviness of the strokes. Weight differences are generally differentiated by an increased stroke or thickness that is associated with a given character in a font, as compared to a "normal" character from that same font.

The FontWeights values correspond to the usWeightClass definition in the OpenType specification. The usWeightClass represents an integer value between 1 and 999. Lower values indicate lighter weights; higher values indicate heavier weights.
Font weight usWeightClass
Thin 100
ExtraLight

UltraLight 200
Light 300
Normal

Regular 400
Medium 500
DemiBold

SemiBold 600
Bold 700
ExtraBold

UltraBold 800
Black

Heavy 900
ExtraBlack

UltraBlack 950

Also about production fonts rasters for moving pictures domain (not dual tone Black and White font original domain) - the conditioning of glyphs raster in scene linear light and in system transfer domain also changes view (visible width/contrast/thickness) of small (thin) parts of glyphs significantly.

" Subtitle() has been hardcoded to only output Bold text"

Not all documented Win API actually working in all documented control paths. So old developers may select simply most frequently working way. General idea of AVS developers looks like keep itself even today - let it be simple in features but easy to support and work in most use cases.

Last edited by DTL; 4th June 2023 at 10:45.
DTL is offline   Reply With Quote
Old 5th June 2023, 15:47   #6  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,308
Due to the public demand , bold and italic parameters (boolean) were introduced (for "Info" as well). When Subtitle acts as "Text" (non-windows systems), "italic" parameter is simply ignored. Font name must be the same ("Arial" for example) and setting bold=false, italic=true will differentiate.
Other filters with less customization option (Compare, ShowSMTPE, ...) have no such parameter, they keep working on with the defaults.
pinterf is offline   Reply With Quote
Old 5th June 2023, 22:17   #7  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Very nice pinterf!

Any possibility of adding a parameter to disable anti-aliasing also? There was some demand for it in this thread: https://forum.doom9.org/showthread.php?t=184627

I know SubtitleEx can do it, which uses Subtitle as the rendering engine.
Reel.Deel is offline   Reply With Quote
Old 7th June 2023, 15:57   #8  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,308
Quote:
Originally Posted by Reel.Deel View Post
Very nice pinterf!

Any possibility of adding a parameter to disable anti-aliasing also? There was some demand for it in this thread: https://forum.doom9.org/showthread.php?t=184627

I know SubtitleEx can do it, which uses Subtitle as the rendering engine.
O.K., noaa parameter was implemented in SubTitle.
All three new parameters (bold/italic/noaa) were added to some debug filters: ShowSMTPE, ShowFrameNumber, ShowCRC32, ShowTime
Check readme_history.txt
pinterf is offline   Reply With Quote
Reply

Tags
subtitle fonts bold

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.