Skip to content

Instantly share code, notes, and snippets.

<?php
//
// OpenStep Property List Parser
//
// Copyright 2024 Florian Pircher
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@florianpircher
florianpircher / Fonts.swift
Created March 7, 2024 20:21
NSFont extensions for setting OpenType features and variation axes
//
// Fonts.swift
//
// Copyright 2021 Florian Pircher
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
@florianpircher
florianpircher / README.md
Created October 27, 2022 23:11 — forked from technic/README.md
change font linespacing for dummy editor #linux #ttf #qtcreator

How to change font linespacing

Manual

You need to manipulate a ttf file. I found such a script that comes with Input font at http://input.fontbureau.com. So we copy DejaVuSansMono ttf files to ~/.fonts/ and create a new font DejaVuSansMonoH. I changed line 147, to match this font name, and run

extension Sequence {
func sorted<SortKey>(
by areInIncreasingOrder: (SortKey, SortKey) throws -> Bool,
sortKey makeSortKey: (Element) throws -> SortKey
) rethrows -> [Element] {
try self
.map { (key: try makeSortKey($0), element: $0) }
.sorted { try areInIncreasingOrder($0.key, $1.key) }
.map { $0.element }
}
@florianpircher
florianpircher / PreferencesTabViewController.swift
Last active August 30, 2022 18:59
A drop-in replacement for a plain NSTabViewController that animates size changes of the preferences window when selecting a different tab.
//
// PreferencesTabViewController.swift
// Light Table
//
// Copyright 2022 Florian Pircher
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
@florianpircher
florianpircher / README.md
Created March 5, 2022 23:21 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
@florianpircher
florianpircher / User Defaults Property Wrappers.swift
Last active January 15, 2022 21:00
Property wrappers for user defaults. For user defaults publishers, see: https://gist.github.com/florianpircher/4513f8def656fc4fe427345bce7b052b
//
// User Defaults Property Wrappers.swift
//
// Copyright 2021 Florian Pircher
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
@florianpircher
florianpircher / User Defaults Publishers.swift
Last active April 14, 2023 16:06
Combine publishers for user defaults. For user defaults property wrappers, see: https://gist.github.com/florianpircher/626174760c2d91bab6defbf1b2b3d4cf
//
// User Defaults Publishers.swift
// Light Table
//
// Copyright 2021 Florian Pircher
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
@florianpircher
florianpircher / Classes.fea
Created October 15, 2021 18:10
Double Combining Marks
##### Space #####
## Horizontal Classes
#@H1 = [$[layer0.width > 0 AND layer0.width <= $classH1Max]];
@H1 = [$[layer0.width > 0 AND layer0.width <= 432]];
#@H3 = [$[layer0.width >= $classH3Min]];
@H3 = [$[layer0.width >= 780]];
## Vertical Classes
##
## -- 5 (ascender)
struct Segment {
start: u16,
end: u16,
id_delta: i16,
}
fn format4_segments(map: &BTreeMap<char, u32>) -> Vec<Segment> {
let mut segments = Vec::<Segment>::new();
let char_spans = map