This repository has been archived by the owner on Nov 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
windows: Add windows install package
Adds an install process to replace Emoji on Windows. It merges the EmojiOne font with Segoe UI Symbol on the user's machine, and replaces Segoe UI Emoji as well on Win 8 and 10. An uninstall script is also included to assist the user in restoring the original Windows fonts. README also updated. Fixes #15
- Loading branch information
Showing
5 changed files
with
178 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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 @@ | ||
*.cmd text eol=crlf |
This file contains 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,115 @@ | ||
@ECHO OFF | ||
SETLOCAL | ||
|
||
SET MS_EMOJI_FONT_PATH="%SystemRoot%\Fonts\seguiemj.ttf" | ||
SET MS_FONT_PATH="%SystemRoot%\Fonts\seguisym.ttf" | ||
SET EMOJI_FONT_PATH="%CD%\EmojiOneColor-SVGinOT.ttf" | ||
SET FINAL_EMJ_FONT_PATH_NO_QUOTES=%CD%\Segoe UI Emoji with EmojiOne.ttf | ||
SET FINAL_EMJ_FONT_PATH="%FINAL_EMJ_FONT_PATH_NO_QUOTES%" | ||
SET FINAL_FONT_PATH_NO_QUOTES=%CD%\Segoe UI Symbol with EmojiOne.ttf | ||
SET FINAL_FONT_PATH="%FINAL_FONT_PATH_NO_QUOTES%" | ||
|
||
ECHO Checking if Segoe UI Emoji is installed | ||
|
||
REM Windows 8 uses Segoe UI Emoji in addition to Symbol | ||
REM Windows 7 only uses Segoe UI Symbol | ||
REM We have to replace _both_ | ||
ECHO Checking if Segoe UI Symbol is installed. | ||
|
||
IF NOT EXIST %MS_FONT_PATH% ( | ||
ECHO. | ||
ECHO You don't seem to have the Segoe UI Symbol Font installed. | ||
ECHO https://support.microsoft.com/en-us/kb/2729094 | ||
GOTO :ERROR | ||
) | ||
|
||
ECHO Checking if prerequisites are installed. | ||
|
||
WHERE python /q || ( | ||
ECHO. | ||
ECHO Python.exe not found, install or add to PATH. | ||
ECHO. | ||
GOTO :ERROR | ||
) | ||
|
||
WHERE pip /q || ( | ||
ECHO. | ||
ECHO Pip.exe not found, install or add to PATH | ||
ECHO. | ||
GOTO :ERROR | ||
) | ||
|
||
ECHO Ensuring the latest FontTools is installed. | ||
|
||
pip install --upgrade https://github.com/behdad/fonttools/archive/master.zip | ||
|
||
PUSHD %TEMP% | ||
IF EXIST %MS_EMOJI_FONT_PATH% ( | ||
ECHO Creating new Segoe UI Emoji font from EmojiOne | ||
ttx -t "name" -o "emjname.ttx" %MS_EMOJI_FONT_PATH% || GOTO :ERROR | ||
ttx -o %FINAL_EMJ_FONT_PATH% -m %EMOJI_FONT_PATH% "emjname.ttx" || GOTO :ERROR | ||
DEL "emjname.ttx" | ||
) | ||
|
||
ECHO Creating new Segoe UI Symbol font from EmojiOne | ||
REM Merge Segoe UI Symbol into EmojiOne, this keeps emoji one's glyph ids intact | ||
REM for the 'SVG ' table data | ||
pyftmerge %EMOJI_FONT_PATH% %MS_FONT_PATH% | ||
ECHO Dumping SVG emojis | ||
ttx -t "SVG " -o "svg.ttx" %EMOJI_FONT_PATH% || GOTO :ERROR | ||
ttx -t "name" -o "name.ttx" %MS_FONT_PATH% || GOTO :ERROR | ||
ECHO Merging in dumped emojis | ||
ttx -o "almost.ttf" -m "merged.ttf" "name.ttx" || GOTO :ERROR | ||
DEL "merged.ttf" | ||
DEL "name.ttx" | ||
ttx -o %FINAL_FONT_PATH% -m "almost.ttf" "svg.ttx" || GOTO :ERROR | ||
DEL "almost.ttf" | ||
DEL "svg.ttx" | ||
REM Get back to working directory. | ||
POPD | ||
|
||
ECHO. | ||
ECHO. | ||
IF EXIST %MS_EMOJI_FONT_PATH% ( | ||
ECHO The fonts are now saved in | ||
ECHO %FINAL_FONT_PATH% | ||
ECHO and | ||
ECHO %FINAL_EMJ_FONT_PATH% | ||
ECHO After installation, the original fonts will still be located at | ||
ECHO %MS_FONT_PATH% | ||
ECHO and | ||
ECHO %MS_EMOJI_FONT_PATH% | ||
) ELSE ( | ||
ECHO The font is now saved in | ||
ECHO %FINAL_FONT_PATH% | ||
ECHO After installation, the original font will still be located at | ||
ECHO %MS_FONT_PATH% | ||
) | ||
ECHO It is not overwritten, and can be reinstalled with uninstall.cmd | ||
ECHO To finish installation, the font will be opened for you to install. | ||
ECHO. | ||
ECHO If the font is in a network path, copy to a local disk and | ||
ECHO double click to install. | ||
ECHO Press the [INSTALL] button in the Font Viewer, then close the viewer. | ||
CHOICE /m "Would you like to install the fonts now?" | ||
IF ERRORLEVEL 2 ( | ||
EXIT /b | ||
) | ||
ECHO. | ||
ECHO Running the font installer for Segoe UI Symbol | ||
REM The font viewer doesn't like quotes for some reason, but is fine with paths with spaces. | ||
fontview %FINAL_FONT_PATH_NO_QUOTES% | ||
if EXIST %MS_EMOJI_FONT_PATH% ( | ||
ECHO. | ||
ECHO Running the font installer for Segoe UI Emoji | ||
fontview %FINAL_EMJ_FONT_PATH_NO_QUOTES% | ||
) | ||
ECHO. | ||
ECHO All Done! | ||
PAUSE | ||
EXIT /b | ||
|
||
:ERROR | ||
ECHO Installation failed! | ||
PAUSE | ||
EXIT /b %ERRORLEVEL% |
This file contains 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,18 @@ | ||
@ECHO OFF | ||
SETLOCAL | ||
|
||
SET MS_EMOJI_FONT_PATH="%SystemRoot%\Fonts\seguiemj.ttf" | ||
SET MS_FONT_PATH="%SystemRoot%\Fonts\seguisym.ttf" | ||
|
||
IF EXIST %MS_EMOJI_FONT_PATH% ( | ||
ECHO Pressing [INSTALL] button in the Font Viewer will reinstall | ||
ECHO the original Segoe UI Emoji font. | ||
fontview %SystemRoot%\Fonts\seguiemj.ttf | ||
) | ||
ECHO. | ||
ECHO Pressing [INSTALL] button in the Font Viewer will reinstall | ||
ECHO the original Segoe UI Symbol font. | ||
fontview %SystemRoot%\Fonts\seguisym.ttf | ||
ECHO. | ||
ECHO All Done! | ||
PAUSE |