How to make fontsize bigger for one letter in matlab plot title - matlab

I want to make \mu to appear the same size as the other letters, how can i do that?
title('Größen-Parameter x in dem spongiösen Knochen(300\mum, 600\mum und 2000\mum)');

To answer the question in the title:
You can adjust the font size of a letter (or a text of any length) with {\fontsize{size},letter}. E.g.:
title('Größen-Parameter x in dem spongiösen Knochen(300{\fontsize{14}\mu}m, 600{\fontsize{14}\mu}m und 2000{\fontsize{14}\mu}m)');
However, your actual problem seems to be that the mu's appear slightly smaller than the rest of the text. The reason for this is that Matlab by default interprets normal text as literal characters (WYSIWYG) while using a latex interpreter if you call a latex command such as \mu. This causes those letters to be displayed differently.
Of course you can just increase the size of those letters, but that's not very elegant and the letters will still have a different style. As an alternative I would suggest using a Latex interpreter for the whole text - aside from solving your problem, it will also look nicer!
title('Groessen-Parameter x in dem spongioesen Knochen (300 $\mu$m, 600 $\mu$m und 2000 $\mu$m)','interpreter','latex');
The only problem are your german special characters (ö and that double s thingy). To display those correctly you would have to load the german language package ngerman. This isn't easy but there are instructions here. However, if you are using a german matlab (if that's a thing) it might work without that.

Related

Characters in FontForge appear distorted

I'm trying to create a font using FontForge which is 'simply' the alphanumeric characters from Lato (original version) as well as the greek alphabet characters from Lato (extended version). I opened both fonts in FontForge and copied and pasted the greek letters over to the original version. I generated the font and displayed it in Google Chrome. But the characters that I've copied come out jagged / distorted. I've also tried opening the original font, then going to element and then merge fonts and selecting the extended version font and then generating a font from that but the same problem occurs.
The screenshot provided below shows the distortion going on. The top line shows how the letters should look. The bottom line shows how the letters actually look. Many of the letters - even the ones that were in the original (such as the 'a') - aren't displaying properly. The bottom and top of some characters has been flattened and for other characters, extended. Notice the top of the alpha, rho and epsilon are pointed and aren't smooth as they should be. The top of the beta has been flattened. Look at the top and bottom of the 'o' - both have been flattened as if to fit into a minimum allowable area.
If I zoom in a lot, the jagged edges become smooth again.
What can I do to fix this?

Adjusting graphical LaTeX text size in Matlab

I am trying this example:
http://www.mathworks.com/help/symbolic/latex.html
Let's say I wanted to resize those labels. How? I can't figure out any LaTeX code, and 'fontsize' does not do the trick.
This hits a sore spot when it comes to Matlab's support for (or use of) Latex. The normal font-size commands from Latex aren't available. (In Latex normally you'd just say \Large{Text ... $x$} or even \normalsize ....)
To do this in a Matlab plot you can add fontsize spec at the end
title(['For $x$ and ...'], 'Interpreter', 'latex', 'fontsize', 14)
For more discussion and how to change font type as well see this post. Note that there are not so many fonts readily available in Matlab. To preserve sanity I'd keep this kind of tweaking to the minimum.
There is another method that will work anywhere in Matlab where you can use Latex -- in any text, in the middle of a string, etc: You can drop to Latex's lower level font specification.
title(['\fontsize{15}{0}\selectfont For $x$ and ...'], 'Interpreter', 'latex')
The first command \fontsize{}{} specifies the font, the second one \selectfont actually changes it for the rest of the text. When you want to switch to a different font, even mid-string, you again issue \fontsize{12}{0}\selectfont and you have that font size after that point. The only thing you need to change is the size (I used 15 and 12 as examples), the rest is boilerplate (for this purpose).
See what these things mean and more discussion in this post. For far more detail on fonts in Matlab see this article. For how to change fonts across the whole document see this post.
There are yet other ways but it gets progressively trickier and this should be enough. Probably the best advice is to set it once for the whole document. That also makes sense typesetting-wise.
Note. The font command of the second example must be given outside of math mode. Latex has two major modes, text and math. To make it go to 'math mode', where it processes everything as it were math symbols, you put a $, or $$. (There are yet many other ways, but in Matlab's strings this is all you'll ever use.) When you want it to go back to typesetting text normally, you end math mode with another $, or $$. All math is in between $...$, everything else is normal text.
This is some text, now typeset some math: $y = x^2$ ... back to text.
The font commands do not work in math mode but need be given outside the $...$. They will apply to any following math as well. In a plot command we'd say
ylabel(['\fontsize{16}{0}\selectfont $\dot{x}$'], 'interpreter','latex');
Here is the line that worked:
ylabel('$x_e, x_c$', 'interpreter','latex', 'fontsize', 32);
Obviously, between the dollar signs can be whatever appropriate LaTeX expression desired.

How can I detect any unicode characters which have descenders, using .NET

I am trying to minimize the vertical distance between controls on a programmatically constructed Windows Form (using C#). This involves setting the Height property appropriately.
I have found that if the text of the control does not contain any letters with descenders in them (i.e. does not have any of the characters j, g, p, q or y) then the control Height can be smaller than when it does contain such letters (if it does contain letters with descenders then the descenders are chopped off if the Height isn't enough).
It will work fine to test for any of the above 5 characters as long as the language is English, or English - like, but I need to be able to cater for (just about) any language.
Is there a way, given some arbitrary Unicode character (and perhaps a font) to determine if that Unicode character has a descender or not?
There is no property defined for Unicode characters to indicate the presence of a descender, and it’s really a feature of glyph design rather than characters. For example, “Q” has a descenders in many fonts, and “J” has one in some. Besides, given the context, you should also consider diacritic marks placed below a letter, not just descenders of base letters. And probably diacritics above letters, too.
So you would need to read the font information (when available) about character dimensions, or tentatively draw characters in your software and measure their dimensions.
As a rule of thumb, any line height below 1.1 times the font size will cause problems with some characters and fonts. Using 1 (“setting solid”) is not enough, because characters may in fact extend outside the font size.
In Windows, you call GetPath() to get an array containing the X/Y coordinates of every point making up the perimeter or outline of the string of glyphs. Search the array for min/max, which will get you the rectangle exactly enclosing the string. Right to the edge of the letters.

font with graphic "blackspace" character

I'm looking for a font which contains a graphic character which is (essentially), the space character, inverted. I'm looking for a graphic character equivalent to the largest-possible solid-black box. The closest I have been able to find is Wingings 2 character 162, but that doesn't fill the entire available character space. When I insert two consecutive Wingdings 2 162 characters, there is still appreciable whitespace between them when displayed or printed. Does anyone know of a black-box font/character which would fill all available character space?
All characters are going to have whitespace between them, or they would be unreadable. This is called "kerning". You can adjust the kerning and line-height in whatever program you are using to send the malicious fax, if you want to be sure to use the maximum amount of toner per page.
Have you considered creating your own font using a software package like this or like this? You could edit the space character to be a solid black square. But as Chris McCall mentioned, you may still have space between characters of any size due to kerning applied by the layout engine that draws the fonts.
You other option is to owner draw your own text and programmatically replacing spaces with black boxes. You would have complete control over kerning and everything else.
I don't know if this is exactly what you were looking for, but...
I was looking for the same thing, since I wanted to create a "textbox" when I wanted to write text using the spritefont, but I never knew how long the total string was going to be, so I wanted something that I could "write" in the same location right before the string with a contrasting color which could be expected to be as long as the string it needed to encompass. That being the case, try:
Webdings - character 103.
I tried lining them up and there wasn't even any space in between. Perfect.

Unicode character that lines up with ⎮ but is as long as ⎢

Sorry if this isn't the right overflow for this question. I need a unicode character that is as long as ⎢ (23A2, LEFT SQUARE BRACKET EXTENSION) but lines up horizontally with ⎮ (23AE, INTEGRAL EXTENSION). Is there such a character?
Take a look at shapecatcher. If you draw a straight line, it shows plenty of different codepoints resembling |.
As already pointed out, exact placement and size may depend on the font, but if you know that the font is going to be a specific one (because you supply it), you could still find the character you're looking for.
It turns out this does depend on the font. If I use DejaVu Sans Mono, INTEGRAL EXTENSION is as long as I want it to be. This font appears to be almost exactly the same as the font I was using, Menlo, except for some small differences with some characters (including this one).