Rank: Advanced Member
Groups: Registered
Joined: 9/23/2017(UTC) Posts: 249 Location: Toronto
Thanks: 13 times Was thanked: 19 time(s) in 17 post(s)
|
Is there a way to auto size the text of a title? I have a data source for a race with a bunch of drivers that comes in via XML live scoring, I'd like to be able to have the majority of the names show up one size as large as possible in the graphic, but if theres an odd driver with a long name, I'd like the size to automatically fit to the text box. Right now I have to manually find the longest name, and ensure it fits, but this leaves a lot of empty space for the "average" length names since they're now really small.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,219 Location: Belgium Thanks: 292 times Was thanked: 955 time(s) in 790 post(s)
|
We do it by putting the Textblock inside a viewbox with a StretchDirection="DownOnly" setting for when a name is a bit to long . Its subtle but effective compared to the other options of stripping the name
Have a GS on "xaml autosize font" or so for examples and more details
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/23/2017(UTC) Posts: 249 Location: Toronto
Thanks: 13 times Was thanked: 19 time(s) in 17 post(s)
|
doggy wrote:We do it by putting the Textblock inside a viewbox with a StretchDirection="DownOnly" setting for when a name is a bit to long . Its subtle but effective compared to the other options of stripping the name
Have a GS on "xaml autosize font" or so for examples and more details
Interesting. I'm not a programmer, I'm a video professional, so this programming knowledge is a little beyond me. I was hoping we could advocate for a simple tick box inside the vMix title designer to accomplish this, rather than have to learn XAML coding. I just tried to add a viewbox via manual editing of the code, but I got an error on import into vMix, I suspect I've done something wrong, but not being a programmer, I have no idea where to look. I feel that auto size text is such a basic function of a titler, that it should be included, rather than have to jump through hoops in manually editing the code, which is not something I'm familiar with at all.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,219 Location: Belgium Thanks: 292 times Was thanked: 955 time(s) in 790 post(s)
|
as i hardly use the vMix TextBlockDesign but the standard TextBlock here is a bit of code. Save as xaml file and load into vmix and enter text and see the font change in size as text becomes longer (basic code is taken from a very basic title created in title designer replacing the <mtl:TextBlockDesign /> bit with Textblock bit) Code:<UserControl Width="1920" Height="1080" Panel.ZIndex="500" InputMethod.IsInputMethodEnabled="True" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mtl="clr-namespace:vMixTitleLibrary;assembly=vMixTitleLibrary">
<Grid InputMethod.IsInputMethodEnabled="True">
<Image Stretch="Fill" Width="1920" Height="1080" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="0" InputMethod.IsInputMethodEnabled="True" />
<Viewbox StretchDirection="DownOnly" Width="485" HorizontalAlignment="Left" Margin="129,23.5,0,21.5" Height="70" >
<TextBlock Name="Name" Text="" Foreground="#FFFFFDFD" FontSize="53.333" >
<TextBlock.Effect>
<DropShadowEffect/>
</TextBlock.Effect>
</TextBlock>
</Viewbox>
</Grid>
</UserControl>
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,219 Location: Belgium Thanks: 292 times Was thanked: 955 time(s) in 790 post(s)
|
btw as a side note :
each of us is a professional in his own field:
I am a professional driver, can change a flat and some small defects as i have a few tools with me (like a vMix title designer) I can also tell something is wrong or needs to change but i don't have the tools nor the detailed insight to fix that so i need to call a professional mechanic and i am on my way again ;-)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/23/2017(UTC) Posts: 249 Location: Toronto
Thanks: 13 times Was thanked: 19 time(s) in 17 post(s)
|
doggy wrote:as i hardly use the vMix TextBlockDesign but the standard TextBlock here is a bit of code. Save as xaml file and load into vmix and enter text and see the font change in size as text becomes longer (basic code is taken from a very basic title created in title designer replacing the <mtl:TextBlockDesign /> bit with Textblock bit) Code:<UserControl Width="1920" Height="1080" Panel.ZIndex="500" InputMethod.IsInputMethodEnabled="True" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mtl="clr-namespace:vMixTitleLibrary;assembly=vMixTitleLibrary">
<Grid InputMethod.IsInputMethodEnabled="True">
<Image Stretch="Fill" Width="1920" Height="1080" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="0" InputMethod.IsInputMethodEnabled="True" />
<Viewbox StretchDirection="DownOnly" Width="485" HorizontalAlignment="Left" Margin="129,23.5,0,21.5" Height="70" >
<TextBlock Name="Name" Text="" Foreground="#FFFFFDFD" FontSize="53.333" >
<TextBlock.Effect>
<DropShadowEffect/>
</TextBlock.Effect>
</TextBlock>
</Viewbox>
</Grid>
</UserControl>
I appreciate the example, it does help me a little bit, but I'm still running into errors, and I strongly suspect it goes back to me not being a programmer. I get what you're saying about hiring someone to do something if its beyond my skills, but when its a simple thing like auto size text, that seems a bit ridiculous. almost any text editor has the ability to constrain to the text block. I'm editing a simple title, so bringing someone in to do this seems overkill. The error I get is: The Viewbox start tag on line 4 does not match the end tag of Viewbox Line 6, Position 7. This is my code: Code:
<UserControl Width="1920" Height="1080" Panel.ZIndex="500" InputMethod.IsInputMethodEnabled="True" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mtl="clr-namespace:vMixTitleLibrary;assembly=vMixTitleLibrary">
<Grid InputMethod.IsInputMethodEnabled="True">
<Image Source="CHAT HP.PNG" Stretch="Fill" Width="1920" Height="1080" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="0"
InputMethod.IsInputMethodEnabled="True" />
<Viewbox StretchDirection="DownOnly" Width="472" HorizontalAlignment="Left" Margin="129,23.5,0,21.5" Height="70" >
<TextBlock Name="Name" Text="" Foreground="#FFFFFDFD" FontSize="53.333"/>
</viewbox>
</Grid>
</UserControl>
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,219 Location: Belgium Thanks: 292 times Was thanked: 955 time(s) in 790 post(s)
|
</viewbox> needs to be </Viewbox> ( Capital V)
Thing is with making text fit there are several was of doing it , like truncating or ending with dot also or chaning to multiline etc , which would one choose as no doubt each person wants his own way of displaying longer texts
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/23/2017(UTC) Posts: 249 Location: Toronto
Thanks: 13 times Was thanked: 19 time(s) in 17 post(s)
|
doggy wrote:</viewbox> needs to be </Viewbox> ( Capital V)
Thing is with making text fit there are several was of doing it , like truncating or ending with dot also or chaning to multiline etc , which would one choose as no doubt each person wants his own way of displaying longer texts It was as simple as a capital V! amazing! haha I get what you're saying, I used to use LiveStream Studio, and it had a dropdown for each text box with multiple options, crop to fit, squeeze to fit, wrap, etc. Thats kinda what I'm advocating for .
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,219 Location: Belgium Thanks: 292 times Was thanked: 955 time(s) in 790 post(s)
|
spencerm24 wrote:doggy wrote: It was as simple as a capital V! amazing! haha
Computers are dumb, you have to tell them everything, not asume ;-)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/23/2017(UTC) Posts: 249 Location: Toronto
Thanks: 13 times Was thanked: 19 time(s) in 17 post(s)
|
ok, I tried to put this into my ACTUAL graphic, and I'm still getting errors. This is what I mean. if there was a simple button to check to truncate, squeeze, etc. I can be an actual designer, not a programmer. This is becoming my biggest beef with vMix, great software, but its forcing video professionals to learn to code, or spend more money to bring someone in when a simple option in settings would accomplish this.
I have 18 items on my graphic I need to do this for, and spending many hours on each one troubleshooting the code is not what I had in mind. I get that for programmers, its "simple" but a title tool should be simple to use for video professionals.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close