vim on iterm cannot open as full screen - vim

I wonder about this bottom and left gap, and also wanna remove it
It occurs only when i open "vim", not Iterm itself
Is there any solution?

The general principle is that the screen of a terminal emulator is a grid where each cell has the same dimensions as the others and those dimensions are determined by the font and font size used. If the window's dimensions and the grid's dimension are incompatible, then the window can't be filled with the grid and you have that kind of gap.
In this case, the cell dimensions are 16px * 38px so the grid can only fit in a box whose dimensions are a multiple of 16 in width and a multiple of 38 in height.
Now, your screen's dimensions appear to be 1630px * 2862px, which is rather unusual. The width is not a multiple of 16 and the height is not a multiple of 38, so, with your current font settings it is impossible to fill the screen.
For that to be theoretically possible, you would need font settings that make individual cells 16.3px wide and 38.16px tall, or some other "impossible" ratio.
Note that you also have a padding, here, that effectively prevents the grid to ever fill the window anyway.
None of that is really a problem when the program you run in your terminal emulator doesn't paint the background of those cells but your Vim colorscheme does, which makes the effect described above apparent.
The only practical workarounds are:
Define the same background in Vim and in your terminal emulator.
Make Vim's background transparent.

Related

UWP Typography recommendations do not seem to work

I am building a UWP application and thought I should honor the Microsoft guidelines with respect to drawing my text. The full typography guidelines can be found at this location.
The guidelines specify the text size and line height. The line height should always be a multiple of 4, to enable good scaling behavior across device and screen sizes. Here is the guideline for the Subtitle text style: -
As can be seen the text size is 20 pixels and the line height 24. But if you create a TextBlock and use the provided SubtitleTextBlockStyle it does not draw correctly. Here is the code to test: -
<TextBlock Style="{ThemeResource SubtitleTextBlockStyle}"
Text="SubtitleTextBlockStyle SubtitleTextBlockStyle SubtitleTextBlockStyle SubtitleTextBlockStyle"/>
You actually get text space at 26 and 27 pixels alternating: -
I tried setting the Margin and Padding of the TextBlock to zero and explicitly setting the LineHeight to be 24. It makes no difference.
It you place two TextBlock instances in a vertical StackPanel then you get a different spacing again, 28 pixels in line spacing between the two sets of text. To me it looks like the guidelines are impossible to actually implement.
Has anybody had any look implementing there own styles that match the guidelines? Or are they simply crap?

PyQt - Keeping spacing at zero during window resize, grid layout

I'm making an emacs-esque toy text editor. At startup, there's one large window (a QTextEdit derivative) in the top center of the screen, with a minibuffer (QLineEdit derivative) underneath. Both of the actual editing widgets are contained in the grids of parent classes called Window and MiniWindow (Window also keeps track of a QLabel that appears directly beneath the QTextEdit).
My Window object is at location 1, 1 in the grid, and my MiniWindow object is at 2, 1. I've set content margins to 0 and spacing to 0, which looks great at first, but when I try to grow the window by dragging on the corner, this starts to happen:
As you can see, the screen is divided into two rows (as it should be), but half of the vertical length of the screen is dedicated to each row. What I need is for the top Window to stretch its length during resizing so that it is always adjacent to the MiniWindow underneath. Is there some other option I need to be setting?
Nevermind, got it.
I was having this problem because the QLineEdit object was in the grid of my container class, MiniWindow. The height of a MiniWindow object is free to vary with the window resizing in a way that a QLineEdit alone would not be. The fix was set to the maximumHeight of MiniWindow to approximately the height of a QLineEdit, which is around 16.
Works great now.

Remove terminal border colors from vim colorschemes

I want the color scheme to span completely across the terminal boundaries. I am using Color Scheme Scroller Plugin to switch between different theme. I have uploaded a .gif file so that you can clearly see what I want to get fixed. Vim colorschemes doesn't completely change the color of editor. There are some terminal color's borders left around the vim's overridden color scheme. How would I fix it.
Please check the image on this link. Stackoverflow doesn't allow uploading an image > 2Mb
You can't do that from Vim itself.
Terminal emulators use that padding to preserve readability when characters are displayed next to the borders of the window. The programs you run in your terminal have no knowledge of that padding and thus no ability to change it.
But you can read the documentation of your terminal emulator or take a look at its source code to find a way to enable/adjust/disable that padding.
FWIW, there's no way to change that in Terminal but it can be done for iTerm.
Alternatively, you could simply set the background color of your terminal to the one used in your vim colorscheme.
The image appears to depict behavior outside vim's control:
it is using a terminal emulator (could be xterm, could be some other).
the terminal emulator draws character cells on a window
those cells form a grid; the window may extend beyond the grid
the window can have a background color
the grid can have a background color
within the grid, most terminals provide some capability of drawing text with specific foreground and background colors
the grid can have a default background color which is not any of the specified colors
outside the grid, the window can also have a default background color
normally, the grid- and window-default backgrounds are the same
the window can be resized to (more or less) arbitrary sizes
the grid is constrained to exact character sizes
because of this difference, the window can have areas outside the grid which use its default color, and not match the grid's background color.
escape sequences which could affect the grid- and window-background colors are doing erases (see for example the ncurses FAQ My terminal shows some uncolored spaces).
though it is conceivable that erasures within the grid could affect those outside areas, doing that generally leads to odd visual effects.

AndroidPlot - Position TextLabelWidget not consistently on different devices

I have a chart show info of apps, but when run it on devices android. The position of text on chart not consistently.
These images illustrate the problem: https://drive.google.com/folderview?id=0B7-CxJHQ5ZnjYjVlTlFQdElWRGM&usp=sharing
I use TextLabelWidget in AndroidPlot. How to keep position of TextLabelWidget on chart with the same image1 in link above on devices?
The problem appears to be that your plot area is set to fill the width of the screen and since the bars are evenly distributed in that space, their x positions are essentially fractions of the screen width.
At the same time you have labels that appear to be positioned using absolute positioning. As an example, this code will position 4 labels at 0%, 25%, 50% and 75% screen width, 80 pixels down from the top of the screen:
txtWidget1.position(0, XLayoutStyle.RELATIVE_TO_LEFT, PixelUtils.dpToPix(80), YLayoutStyle.ABSOLUTE_FROM_TOP, AnchorPosition.LEFT_TOP);
txtWidget2.position(0.25f, XLayoutStyle.RELATIVE_TO_LEFT, PixelUtils.dpToPix(80), YLayoutStyle.ABSOLUTE_FROM_TOP, AnchorPosition.LEFT_TOP);
txtWidget3.position(0.50f, XLayoutStyle.RELATIVE_TO_LEFT, PixelUtils.dpToPix(80), YLayoutStyle.ABSOLUTE_FROM_TOP, AnchorPosition.LEFT_TOP);
txtWidget4.position(0.75f, XLayoutStyle.RELATIVE_TO_LEFT, PixelUtils.dpToPix(80), YLayoutStyle.ABSOLUTE_FROM_TOP, AnchorPosition.LEFT_TOP);
There are some other factors that you are also probably going to need to deal with such as bar width but this should get you closer. You may find this doc useful as far as a guide for the different positioning methods.
Another tool to consider using if you aren't using it already is the Configurator. This will let you set your positions etc. inside xml and override values based on screen size, orientation, etc.

How do I display same "proportional" text size on different resolutions?

I draw some text on screen using ID3DXFont::DrawText. This text should be displayed the same regardless of screen resolution.
For example, if screen resolution is low, text wrapped and when it is higher text is not wrapped. How can I avoid such situation? I want text size to be connected to screen resolution so if resolution is lower I want the text to be relatively smaller so that no wrapping happens. Is there any way?
Thanks in advance
Below is a logical solution. It doesn't have any of the code or procedures needed to make work in direct X but having done something similar outside of DirectX I wanted to share the logic
Working on whatever default screen resolution you want set the font to be the size needed.
Find the percentage of the screen height the font size you chose takes up.
Then having stored that value when you go to render again, in the final version of the program, calculate the font size based on the screen size and the percentage
What I was working in had functions like GetTextHeight and properties on the font size to allow you to set the height (which in turn set the font size appropriately). So if can find anything similar to this in DirectX than this could be a route for you to take.

Resources