How to have subpixel rendering of font for LCD (cleartype on windows) on linux? - linux

I am working on embedded system, with own windowing system and rendering library. Before someday when I installed Ubuntu, to my surprise it has LCD subpixel rendering. It really looks cool to have it on my device. Because it is very readable.
Currently I ask for particular glyph in freetype, freetype gives me one memory buffer with values of alpha, with that it is not possible to have subpixel rendering. What I have is normal antialiazed font. As in subpixel - rendering left most pixel of font is anti-aliazed with Red and Rightmost with Blue ( Assuming Screen is RGB ).
Is there any methods with which freetype can give me information that whether current pixel is left or right or centerone?
Thanks, Sunny.

freetype can do it

As you point out, the desktop environment you're using (GNOME, KDE, whatever) may implement this. The setting for it varies by environment.
As to how to do it in your own code, you can use the same routines the window manager does (Gtk+ on GNOME, Qt on KDE, etc.), or you can use a separate library like FreeType or SDL_ttf. Antialiasing -- the generic term for this, as ClearType is a patented algorithm specific to Microsoft -- is usually optional in these libraries, disabled by default for speed.

I think that libcairo is at the bottom of most GTK applications in Ubuntu that do antialiasing. I think that whether subpixel rendering is done specifically for an LCD screen is something the user chooses, not the application author. The user controls it through the "Fonts" tab of "Appearance Preferences" in System -> Preferences -> Appearance (which can be run manually as the binary "gnome-appearance-properties") and clicking on the "Subpixel smoothing (LCDs)" option.
Maybe there's a way that an application can override this setting for themselves? Not sure why they'd want to, though, since an app doesn't control what kind of display the user is using.

Related

Displaying a Classification Banner at the top of each computer monitor in Gnome Desktop

I work in an environment where we have to have a security classification banner displayed at the top of each monitor on our Gnome Desktops. Currently, I am using a Perl/Tk window to display the classification of the system. However, that window cannot be moved because of the way it is built (no decorations) and occasionally overlays open windows making it difficult for users to manage those windows.
I would like to be able to do something different, but I'm not sure where to start. Three ideas I have are this:
An icon or something in the Top Bar showing the classification
A banner, like the Top Bar, that sits above the Top Bar
A window, like I already have, but relocatable
I figure the first option would be easiest, but since the Top Bar isn't shown on every monitor, that may not be the best option. I don't even know if the second option is even possible. The third option would require me to use something other than Perl/Tk but that's the only language I'm fluent in at the moment.
So I'm looking for suggestions or examples or Gnome extensions I can use to solve this problem.
Thanks.
There is a classification-banner python utility at https://github.com/fcaviggia/classification-banner. It's no longer maintained, but we've been using it without change for a few years now. It's OK. One problem is that it doesn't "shrink" the desktop screen, so application windows can overlap it; it's set to Always On Top, but it would be nicer if it actually couldn't be overlaid at all.
A simple solution, of sorts, would be to change the desktop background image. This can have issues if you're displaying on multiple resolutions (I don't know if Gnome supports SVG for such purposes) and of course it can be obscured by windows covering it.
Older versions of Gnome let you create multiple bars that worked perfectly, but that disappeared - along with many other customizations - in Gnome 3.

Can ZeroBrane windows have a dark theme without using OS's high-contrast theme?

Just to clarify, I'm not talking about making the background of the editing frame or window dark via:
local G = ...
styles = G.loadfile('cfg/tomorrow.lua')('Zenburn') -- theme
I'm talking about making the background of the Project frame/window, Output window, the menu bar, etc., all dark too.
Is this possible to do without using Windows's high-contrast theme for everything?
Thank you.
I don't think this is possible, as it relies on wxwidgets to draw those windows and wxwidgets uses system-provided colors to draw them (without much if any user control).
I opened a wxwidgets ticket that would implement re-configuring system colors, but there hasn't been much movement on it.

Wayland surface position

I know Wayland protocol doesn't provide option to control shell surface position on the screen. I would like to find a way for controlling window/surface placement. I have tried tools like xdotool and wmctrl, but they only recognize XWayland windows. I am using Gnome Shell so the window manager is Mutter. Why is surface location not part of Wayland protocol? What would be the suggested way or ways for controlling Wayland surface placement programmatically?
Edit:
Wayland client-protocol provides interface for sub-surfaces and it is sufficient for my purposes at the moment. However window I would hope protocol to include top-level window position option. I could make gnome-shell extension with, javascript? But not really an option in this case.

How to change font size in 'Screen', the screen manager used by Limp to connect to SBCL?

I recently started using Lisp and Limp is the only available plugin for VIM. But, once I set it up and hit F12, the terminal like window that appears has a very small font size. I have a screen resolution of 1920x1080 and it's impractical to read such small fonts. I went through the man page of 'screen', but couldn't find any useful information on changing the font or font size. Is there a way to do this?
And how about using something like 'xterm' rather than 'screen'? I looked through the code of bridge.vim. I don't think it is too much of a task. Any ideas on this?
By screen, do you mean GNU screen?
GNU screen is a terminal emulator that runs in another terminal or emulator. It has no direct control over font sizes; it's purely text based. The window you're seeing must be some GUI terminal emulator; you haven't told us enough to guess which one (could be xterm, could be Gnome terminal, etc.).
For xterm, control-right-click should bring up the "VT Fonts" menu, which will let you select a different font. If none of the available fonts are to your liking, you can use X resources to reconfigure the options, including the choice for the default font.
xterm also supports a control sequence that sets the current font. You have to know the name of the font you want. xlsfonts will show you a very long list of font names (it just showed me 5594 of them). For example, if you run this from a shell running in xterm:
printf '\e]50;-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1\a'
it should give you the font I usually use. But screen generally intercepts escape sequences like that, so it probably won't work from screen under xterm.
Other terminal emulators should have similar mechanisms.

Is there any Opensource Browser for touchscreen device?

I need internet browser on my device which has 4.3 Inch screen with 480x272 resolution, I am using embedded Qt 4.6.2 on embedded linux. Micro-controller has ARM9 with 450 Mhz.
Requirements for browser are
Touch Screen Support, Panning ( No Scroll bars)
Single touch Zooming ( No Multi Touch Available).
Fit to screen width support ( No Horizontal Scrolling).
Acid 3 Standard Compliable.
Page loading should be like, display all visible text first
and then load and show Images Gradually.
Is there any opensource browser which is near to this requirements.
I found following browsers which have touch screen support.
Firefox Mobile
Maemo MicroB ( Can any one please tell me where can I found source of this one).
Maemo MicroB ( Can any one please tell
me where can I found source of this
one).
If it helps: MicroB source package is here.
As a user of this browser I can say that it is very touch-friendly. Can't confirm support of all the features you've listed though.
How about using dillo? Dillo
or how about the QT/Webkit since you are already using QT? You could also look at Midori but I have never used it. For the touch sensor part this depends on your touch drivers. Perhaps run a window manager.

Resources