mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-13 20:14:12 +02:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7926a140b8 | ||
|
|
023487a1d7 | ||
|
|
71f84b1023 | ||
|
|
ce85382c68 | ||
|
|
94d248d812 |
@@ -3,6 +3,16 @@ Changelog
|
|||||||
|
|
||||||
kitty is a feature full, cross-platform, *fast*, GPU based terminal emulator.
|
kitty is a feature full, cross-platform, *fast*, GPU based terminal emulator.
|
||||||
|
|
||||||
|
version 0.8.4 [2018-03-31]
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
- Fix presence of XDG_CONFIG_DIRS and absence of XDG_CONFIG_HOME preventing
|
||||||
|
kitty from starting
|
||||||
|
|
||||||
|
- Revert change in last release to cell width calculation. Instead just clip
|
||||||
|
the right edges of characters that overflow the cell by at most two pixels
|
||||||
|
|
||||||
|
|
||||||
version 0.8.3 [2018-03-29]
|
version 0.8.3 [2018-03-29]
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from collections import namedtuple
|
|||||||
from .fast_data_types import set_boss as set_c_boss
|
from .fast_data_types import set_boss as set_c_boss
|
||||||
|
|
||||||
appname = 'kitty'
|
appname = 'kitty'
|
||||||
version = (0, 8, 3)
|
version = (0, 8, 4)
|
||||||
str_version = '.'.join(map(str, version))
|
str_version = '.'.join(map(str, version))
|
||||||
_plat = sys.platform.lower()
|
_plat = sys.platform.lower()
|
||||||
is_macos = 'darwin' in _plat
|
is_macos = 'darwin' in _plat
|
||||||
@@ -35,7 +35,7 @@ def _get_config_dir():
|
|||||||
locations.append(os.path.expanduser('~/Library/Preferences'))
|
locations.append(os.path.expanduser('~/Library/Preferences'))
|
||||||
if 'XDG_CONFIG_DIRS' in os.environ:
|
if 'XDG_CONFIG_DIRS' in os.environ:
|
||||||
for loc in os.environ['XDG_CONFIG_DIRS'].split(os.pathsep):
|
for loc in os.environ['XDG_CONFIG_DIRS'].split(os.pathsep):
|
||||||
locations.append(os.path.abspath(os.path.expanduser(os.environ['XDG_CONFIG_HOME'])))
|
locations.append(os.path.abspath(os.path.expanduser(loc)))
|
||||||
for loc in locations:
|
for loc in locations:
|
||||||
if loc:
|
if loc:
|
||||||
q = os.path.join(loc, appname)
|
q = os.path.join(loc, appname)
|
||||||
|
|||||||
@@ -278,12 +278,8 @@ calc_cell_width(Face *self) {
|
|||||||
unsigned int ans = 0;
|
unsigned int ans = 0;
|
||||||
for (char_type i = 32; i < 128; i++) {
|
for (char_type i = 32; i < 128; i++) {
|
||||||
int glyph_index = FT_Get_Char_Index(self->face, i);
|
int glyph_index = FT_Get_Char_Index(self->face, i);
|
||||||
// We actually render the bitmap and get its width even though this is very slow, because
|
if (load_glyph(self, glyph_index, FT_LOAD_DEFAULT)) {
|
||||||
// there are fonts for which the horizontal advance is incorrect, see https://github.com/kovidgoyal/kitty/issues/352
|
ans = MAX(ans, (unsigned int)ceilf((float)self->face->glyph->metrics.horiAdvance / 64.f));
|
||||||
if (load_glyph(self, glyph_index, FT_LOAD_RENDER)) {
|
|
||||||
unsigned int horizontal_advance = (unsigned int)ceilf((float)self->face->glyph->metrics.horiAdvance / 64.f);
|
|
||||||
ans = MAX(ans, self->face->glyph->bitmap.width);
|
|
||||||
ans = MAX(ans, horizontal_advance);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ans;
|
return ans;
|
||||||
@@ -328,7 +324,6 @@ typedef struct {
|
|||||||
unsigned int factor, right_edge;
|
unsigned int factor, right_edge;
|
||||||
} ProcessedBitmap;
|
} ProcessedBitmap;
|
||||||
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
trim_borders(ProcessedBitmap *ans, size_t extra) {
|
trim_borders(ProcessedBitmap *ans, size_t extra) {
|
||||||
bool column_has_text = false;
|
bool column_has_text = false;
|
||||||
@@ -358,9 +353,13 @@ render_bitmap(Face *self, int glyph_id, ProcessedBitmap *ans, unsigned int cell_
|
|||||||
ans->rows = bitmap->rows;
|
ans->rows = bitmap->rows;
|
||||||
ans->pixel_mode = bitmap->pixel_mode;
|
ans->pixel_mode = bitmap->pixel_mode;
|
||||||
if (ans->width > max_width) {
|
if (ans->width > max_width) {
|
||||||
size_t extra = bitmap->width - max_width;
|
size_t extra = ans->width - max_width;
|
||||||
if (italic && extra < cell_width / 2) {
|
if (italic && extra < cell_width / 2) {
|
||||||
trim_borders(ans, extra);
|
trim_borders(ans, extra);
|
||||||
|
} else if (extra == 2 && num_cells == 1) {
|
||||||
|
// there exist fonts that have bitmaps just a couple of pixels
|
||||||
|
// wider than their advances, rather than rescale, which looks
|
||||||
|
// bad, we just crop the bitmap on the right. See https://github.com/kovidgoyal/kitty/issues/352
|
||||||
} else if (rescale && self->is_scalable && extra > 1) {
|
} else if (rescale && self->is_scalable && extra > 1) {
|
||||||
FT_F26Dot6 char_width = self->char_width, char_height = self->char_height;
|
FT_F26Dot6 char_width = self->char_width, char_height = self->char_height;
|
||||||
float ar = (float)max_width / (float)bitmap->width;
|
float ar = (float)max_width / (float)bitmap->width;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ for sz in (16, 32, 64, 128, 256, 512, 1024):
|
|||||||
iname = 'icon_{0}x{0}.png'.format(sz)
|
iname = 'icon_{0}x{0}.png'.format(sz)
|
||||||
iname2x = 'icon_{0}x{0}@2x.png'.format(sz // 2)
|
iname2x = 'icon_{0}x{0}@2x.png'.format(sz // 2)
|
||||||
render(iname, sz)
|
render(iname, sz)
|
||||||
if sz > 16:
|
if sz > 16 and sz != 128:
|
||||||
shutil.copy2(iname, iname2x)
|
shutil.copy2(iname, iname2x)
|
||||||
if sz > 512:
|
if sz in (64, 1024):
|
||||||
os.remove(iname)
|
os.remove(iname)
|
||||||
|
|||||||
Reference in New Issue
Block a user