I have defined some symbols with text properties to act as a label for some other symbols. With the text-halo property I tried to make a background for the text. However, when zoomed out, the text starts clipping and becomes quite unreadable. Example below:
The layout of these four symbols is defined as follows:
'text-font': ['Open Sans Regular'],
'text-field': '{metadata}',
'symbol-placement': 'point',
'text-size': 20,
'text-allow-overlap': true,
'text-offset': [0, -2],
'text-anchor': 'top'
And the paint property of the symbols:
'text-halo-color': '#fff',
'text-halo-width': 5
I want the label on top covering the others completely, like the behaviour of a z-index in CSS. Any ideas? I already tried a dozen combinations of all the possible property values but can't seem to find anything.
As you have noticed, all halos are drawn first, then text. So a halo will never cover the text of another layer. This behaviour is intentional, and has been discussed here.
The obvious workaround would be to not use text-allow-overlap, and find some other solution to whatever problem you were trying to solve using that.
Related
I enabled gridlines like below.
tree.EnableGridLines = TreeViewGridLines.Both;
But the problem is the lines are barely visible like below (if you think there are no gridlines, zoom the image, and look really hard). Gtk.TreeView had GridLineWidth, but it was read-only. How can I make them more visible?
I have tried to find C# equivalent of the answer's C code and the following worked. Making the gridlines thicker worked but the problem was that in Ubuntu, the colour of the gridline is too light that it was not really visible even it it were thicker. So, I changed the colour instead.
var p = new CssProvider();
p.LoadFromData("*{border-color:darkgray;}");
tree.StyleContext.AddProvider(p,Gtk.StyleProviderPriority.Application);
You could use a CSS provider and set the grid line width to a larger value than one pixel. Again, the following code snippets are written in "C"; however, it should be easy enough to interpret the code to use equivalent C# statements.
First, off one would create a GTK CSS provider.
GtkCssProvider *provider;
provider = gtk_css_provider_new();
Then, the customized CSS style information would be defined for the CSS provider widget and the CSS provider widget would be associated with your tree view.
gtk_css_provider_load_from_data(provider, "*{-GtkTreeView-grid-line-width: 4;}", -1, NULL);
gtk_style_context_add_provider(gtk_widget_get_style_context(view), GTK_STYLE_PROVIDER(provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
Note that GTK defines a specific set of attributes for grid elements as opposed to using a standard element such as "border-width". The attribute needing customization in this scenario is "-GtkTreeView-grid-line-width".
Having set the grid width to an exaggerated width of four pixels, the following sample illustrates the effect of the custom CSS style enhancement.
I hope that points you in the correct direction.
Regards.
I am trying to setup a style based on bootstrap3.
Basically I want to try and reduce the size of the input elements which I have done, getting a decent proportion of 'box' vs 'text'.
However if I use the same font-size in a select box with the same size then I get a situation where the text is masked along the bottom edge...
I think there is a tiny bit more margin at the top of the select box, but for the life of me I cant find where that is set in BootStrap to change it (if at all).
I think all I need to do is move the text in the 'select' element up by a couple of pixels and it will align with those bits of text in standard text boxes....
Can anyone point me in the right direct please?
Found the associated CSS in the bootstrap, with a bit of trial and error....
Mainly in the 'form-control' section.
but now also using Bootstrap 4, with a couple of additional styles.
I am playing with the visual effect of plots, and a question came up while changing the style of a legend.
To be able to save the figure with legends big enough that can be seen usually one needs to change the FontSize property to e.g. 24. When you do that, the size of the font changes, however, the small line next to it has the same size than when it was small. The proportion between line/text seem quite appropriate to me with a FontSize of around 10, while I believe that with big font sizes bigger "eat" visually the line, which is the important part.
Example with fontsize 30 and 10 (please ignore how much I suck in mspaint and the low resolution of the zoomed legend). The proportion between line/text is nicer in the small one.
I was wondering if there is a way to modify that line. I have been checking the properties but I haven't found any relevant one.
NOTE: The LineWidth property does not change the width of the colour lines, but the width of the bounding box.
You could play with the outputs arguments of legend, especially the icons variable (check here).
According to the docs, they correspond to
Objects used to create the legend icons and descriptions, returned as
text, patch, and line object.
Therefore you might use something like this to modify the LineWidth property of any of your plot, or both of course:
clear
clc
close all
x = 1:10;
plot(x,rand(1,10));
hold on;
plot(x,x,'k');
[h,icons,plots,str] = legend('First plot','Second plot','Location','NorthWest');
set(h,'FontSize',30);
set(icons(:),'LineWidth',2); %// Or whatever
Which outputs:
Note that I used R2014a so it might be a bit different for R2014b.
I am trying to use PNG images as Toolbar icons. I am currently reading them with imread an set the corresponding CData value.
Now I have some images with transparency. There is no alpha channel (I found some threads with solutions for that), but I get some kind of "Simple Transparency". The imfread function returns "simple" for the Transparency field and a vector of values between 0 and 1 for the SimpleTransparencyData field.
I couldn't find any information about this transparency type neither in the Matlab help nor the internet. So I would like to know if it is possible to show the transparent image in the toolbar directly, or if not how to composite the transparent values with the toolbar's background color.
In summary you set the CData value to be a NaN to represent transparency.
See this article that I wrote on undocumentedmatlab.com which describes how to do it for uicontrols.
For a toolbar icon you modify the CData property in the same way - the primary difference is that you dont need to modify the backgroundcolor property.
I did a quick test on the only solution I could probably imagine and it really seems to work:
I forgot to mention, that I am using indexed PNG files for this. But this sort of transparency seems to imply this fact.
The indexed colors are ordered that the (partially) transparent colors are at the beginning of the table. The SimpleTransparencyData now specifies the transparency of each of the indexed colors. Non-transparent colors are left out, as there are more colors than transparency values.
With that additional information it is easy to composite a single background color with the image.
Within MS Word 2013 I am trying to create a text element plus a list underneath it, all wrapped inside a coloured border with background shading (see image). The attached image shows the text in plain form.
I would like to place a blue border around both the title and the list. I can achieve this by placing both objects within a 1x1 table and applying colouring rules to the cell, but semantically this seems bad (I'm from an HTML development background where it is very wrong!)
When I edit a Style rule to create the border/background, it works well until I create the list, then it goes badly wrong. Is it possible to achieve the output of the table cell approach by only using a style rule and no table?
After a day of experimentation, the closest I can get is by doing the following:
Create a style rule called Tips Heading based on Normal, then set it to be Bold with a blue background.
Create another style rule called Tips List based on List Paragraph, and set it to have a blue background.
Unfortunately the List cannot be indented because the background colour also indents. The border is also affected in this manner, so I ignored the border and indentation. It works really well and is semantically well structured.