-
Notifications
You must be signed in to change notification settings - Fork 188
Fonts Package #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fonts Package #212
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # 𝑭𝘰𝔫𝘁𝓼 Galore | ||
| This package allows you to replace any old text with a fancified version using fonts! | ||
|
|
||
| ## Installation | ||
| Install this package using | ||
| ```sh | ||
| espanso install fonts | ||
| ``` | ||
|
|
||
| ## Usage | ||
| This package replaces text found, up to a final colon, with the same text, but fancified using the specified font. | ||
|
|
||
| In order for this font to work, you may need to install Python 3 in order to allow the script to run. You can view a tutorial to do that [here](https://www.reddit.com/r/learnpython/comments/8lkmjf/python_3_installation_guide/). | ||
|
|
||
| This package also may not be as useful given the Espanso regex limit, which is set to 30 by default. To change this (**highly recommended**), navigate to the Espanso config file and adjust `max_regex_buffer_size:` to a higher value, I recommend anywhere from 500 - 2000 (*note that this will increase Espanso's memory usage*). | ||
|
|
||
| | Shortcut | Name | Example | | ||
| |--------------| - | - | | ||
| | :b 𝘵𝘦𝘹𝘵: | Bold | 𝗟𝗼𝗿𝗲𝗺 𝗜𝗽𝘀𝘂𝗺 | | ||
| | :i 𝘵𝘦𝘹𝘵: | Italics | 𝘓𝘰𝘳𝘦𝘮 𝘐𝘱𝘴𝘶𝘮 | | ||
| | :s 𝘵𝘦𝘹𝘵: | Script | 𝓛𝓸𝓻𝓮𝓶 𝓘𝓹𝓼𝓾𝓶 | | ||
| | :g 𝘵𝘦𝘹𝘵: | Gothic | 𝔏𝔬𝔯𝔢𝔪 ℑ𝔭𝔰𝔲𝔪 | | ||
| | :f 𝘵𝘦𝘹𝘵: | Fancy | 𝑳𝒐𝒓𝒆𝒎 𝑰𝒑𝒔𝒖𝒎 | | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| name: "fonts" | ||
| title: "Fonts" | ||
| description: A package to convert text to fancy fonts anywhere on your computer! | ||
| version: 0.1.0 | ||
| author: SirAardvark | ||
| tags: ["Fun", "Writing"] | ||
|
smeech marked this conversation as resolved.
|
||
| homepage: "https://github.com/S1rAardvark/font-package" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| matches: | ||
|
smeech marked this conversation as resolved.
|
||
| - regex: ":(?P<style>[bisgf]) (?P<text>[^:]+):" | ||
| replace: "{{output}}" | ||
| vars: | ||
| - name: output | ||
| type: script | ||
| params: | ||
| args: | ||
| - python | ||
| - -c | ||
| - | | ||
| import sys, codecs | ||
|
|
||
| # Ensure UTF-8 output | ||
| sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) | ||
|
|
||
| style_map = { | ||
| 'b': '𝗮𝗯𝗰𝗱𝗲𝗳𝗴𝗵𝗶𝗷𝗸𝗹𝗺𝗻𝗼𝗽𝗾𝗿𝘀𝘁𝘂𝘃𝘄𝘅𝘆𝘇𝗔𝗕𝗖𝗗𝗘𝗙𝗚𝗛𝗜𝗝𝗞𝗟𝗠𝗡𝗢𝗣𝗤𝗥𝗦𝗧𝗨𝗩𝗪𝗫𝗬𝗭𝟬𝟭𝟮𝟯𝟰𝟱𝟲𝟳𝟴𝟵 ', | ||
| 'i': '𝘢𝘣𝘤𝘥𝘦𝘧𝘨𝘩𝘪𝘫𝘬𝘭𝘮𝘯𝘰𝘱𝘲𝘳𝘴𝘵𝘶𝘷𝘸𝘹𝘺𝘻𝘈𝘉𝘊𝘋𝘌𝘍𝘎𝘏𝘐𝘑𝘒𝘓𝘔𝘕𝘖𝘗𝘘𝘙𝘚𝘛𝘜𝘝𝘞𝘟𝘠𝘡0123456789 ', | ||
| 's': '𝓪𝓫𝓬𝓭𝓮𝓯𝓰𝓱𝓲𝓳𝓴𝓵𝓶𝓷𝓸𝓹𝓺𝓻𝓼𝓽𝓾𝓿𝔀𝔁𝔂𝔃𝓐𝓑𝓒𝓓𝓔𝓕𝓖𝓗𝓘𝓙𝓚𝓛𝓜𝓝𝓞𝓟𝓠𝓡𝓢𝓣𝓤𝓥𝓦𝓧𝓨𝓩0123456789 ', | ||
| 'g': '𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔴𝔵𝔶𝔷𝔄𝔅ℭ𝔇𝔈𝔉𝔊ℌℑ𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔ℜ𝔖𝔗𝔘𝔙𝔚𝔛𝔜ℨ0123456789 ', | ||
| 'f': '𝒂𝒃𝒄𝒅𝒆𝒇𝒈𝒉𝒊𝒋𝒌𝒍𝒎𝒏𝒐𝒑𝒒𝒓𝒔𝒕𝒖𝒗𝒘𝒙𝒚𝒛𝑨𝑩𝑪𝑫𝑬𝑭𝑮𝑯𝑰𝑱𝑲𝑳𝑴𝑵𝑶𝑷𝑸𝑹𝑺𝑻𝑼𝑽𝑾𝑿𝒀𝒁0123456789 ' | ||
| } | ||
|
|
||
| src = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ' | ||
| text_to_convert = r'''{{text}}''' | ||
| style_key = '{{style}}' | ||
|
|
||
| if style_key in style_map: | ||
|
smeech marked this conversation as resolved.
|
||
| table = str.maketrans(src, style_map[style_key]) | ||
| print(text_to_convert.translate(table), end='') | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.