How to automatically scale font size for a group of controls?

I have a few TextBlocks in WPF in a Grid that I would like to scale depending on their available width / height. When I searched for automatically scaling Font size the typical suggestion is to put the TextBlock into a ViewBox. So I did this: <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width=”*” /> <ColumnDefinition Width=”*” /> <ColumnDefinition … Read more

How to set font size of Matplotlib axis Legend?

I have a code like this: import matplotlib.pyplot as plt from matplotlib.pyplot import * from matplotlib.font_manager import FontProperties fontP = FontProperties() fontP.set_size(‘xx-small’) fig=plt.figure() ax1=fig.add_subplot(111) plot([1,2,3], label=”test1″) ax1.legend(loc=0, ncol=1, bbox_to_anchor=(0, 0, 1, 1), prop = fontP,fancybox=True,shadow=False,title=’LEGEND’) It can be seen in the plot that the setting in Fontsize does not affect the Legend Title font … Read more

How to change the Font size in UIPickerView?

I have one UIPickerView. This is having nearly 200 items, each items has long texts, so, i want to resize the UIPickerView’s font size. How can i change it? It is possible? Can any one help me? Thanks ! Yuva.M Answer You need to implement pickerView:viewForRow:forComponent:reusingView: method in picker’s delegate – (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row … Read more

How to change Bootstrap’s global default font size?

Bootstrap’s global default font-size is 14px, with a line-height of 1.428. How can I change its default global settings? Will I have to change bootstrap.min.css in all the multiple entries? Answer Bootstrap uses the variable: $font-size-base: 1rem; // Assumes the browser default, typically 16px I don’t recommend mucking with this, but you can. Best practice … Read more

How to calculate WPF TextBlock width for its known font size and characters?

Let’s say I have TextBlock with text “Some Text” and font size 10.0. How I can calculate appropriate TextBlock width? Answer Use the FormattedText class. I made a helper function in my code: private Size MeasureString(string candidate) { var formattedText = new FormattedText( candidate, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, new Typeface(this.textBlock.FontFamily, this.textBlock.FontStyle, this.textBlock.FontWeight, this.textBlock.FontStretch), this.textBlock.FontSize, Brushes.Black, new NumberSubstitution(), … Read more

How to change font size in VS Code sidebar?

Querying for fontsize in User Settings window yields only settings for: editor panes, suggest widget, markdown preview, integrated terminal as you can see below: Doing the same for sidebar gives even poorer results: Having fonts of different sizes in editor panes and sidebar looks… let’s settle with: not too nice. Have I just found the … Read more