Skip to content
This repository has been archived by the owner on Nov 10, 2018. It is now read-only.

windows: Add windows build #47

Merged
merged 1 commit into from
Jul 25, 2016
Merged

windows: Add windows build #47

merged 1 commit into from
Jul 25, 2016

Conversation

yincrash
Copy link
Contributor

@yincrash yincrash commented Jul 5, 2016

This requires the builder to supply a Segoe UI Symbol input font
and will merge the regular font with the input font.

For #15

@yincrash
Copy link
Contributor Author

yincrash commented Jul 5, 2016

Hmm. Maybe I should change this to be a Windows batch script that can just take in the EmojiOne and Segue UI fonts? So a user wouldn't have to attempt to use the build system on Windows.

@@ -0,0 +1,54 @@
#!/usr/bin/env python2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the license on this code? Did you write all of it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used this sample script in font tools as inspiration. It's under an MIT style license as well, however I'm not sure what the guideline is for attribution here.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behdad Esfahbod wrote it. So, I'd add a copy of the MIT license copyright him.

@13rac1
Copy link
Owner

13rac1 commented Jul 5, 2016

Thanks for a great PR! Even followed my git commit message standard 😍

Maybe I should change this to be a Windows batch script that can just take in the EmojiOne and Segue UI fonts?

Yes, I think so. The overall build doesn't run on Windows. Right now I am thinking it would be best as a batch file in a EmojiOneColor-SVGinOT-Win-1.3.zip file. People will be able to download the zip, then ideally just run the batch file (which can check the default source ttf location).

@13rac1
Copy link
Owner

13rac1 commented Jul 7, 2016

Could you rebase this into one commit and force push to this branch? It'll be something like:

git rebase -i b6d5340
# Set your original commit to squash, then save
git push -f

@13rac1
Copy link
Owner

13rac1 commented Jul 7, 2016

This will need install directions added to the README. What versions of Windows does this support? 8 and 10?

@yincrash
Copy link
Contributor Author

yincrash commented Jul 7, 2016

I meant to push this to a -wip branch so it wouldn't hit the PR yet. Will do on the squashing. I'm downloading Microsoft's testing VM to try this on 8 and 10, since I only use 7. I think I might have to edit it a bit because I think they use a different font name. I'll add to the README once I know that's settled.

@yincrash yincrash force-pushed the windows branch 4 times, most recently from 126e06a to 27647ce Compare July 8, 2016 05:20
@yincrash
Copy link
Contributor Author

yincrash commented Jul 8, 2016

Tested on both 8 and 10. On those versions, both the Emoji and the Symbol font need to be replaced.

Also updated the README.

from: https://github.com/eosrei/emojione-color-font/releases

Help wanted: [How to override the Windows default Segoe UI Emoji font][16]
There are two install options for OS X. Both SVGinOT versions are available
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OS X

;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops! Fixed.

@13rac1
Copy link
Owner

13rac1 commented Jul 11, 2016

I'll test this later this week. Thank you for your work on it! 😉

@13rac1
Copy link
Owner

13rac1 commented Jul 13, 2016

Just found this. You might have made a solution ;) http://superuser.com/questions/1062418/how-do-i-replace-windows-10s-emoji

@13rac1
Copy link
Owner

13rac1 commented Jul 17, 2016

Building the V1.3 packages right now...

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%
REM pyftmerge doesn't generate a cmap4 table if either font has a cmap12 table
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way we can fix this in SCFBuild?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually fixed this in FontTools, so it will be in whatever their next release is. The emoji font has the correct tables, it was FontTool's fault that the merge was incorrect. That's what the python script corrects, and what my PR for them fixed.

@13rac1
Copy link
Owner

13rac1 commented Jul 17, 2016

EmojiOneColor-SVGinOT-Win-1.3.zip is built. I'll try it on my Win10 desktop tomorrow. Thank you 😄

@13rac1
Copy link
Owner

13rac1 commented Jul 17, 2016

I'm using Windows for the first time this year. What have you done to me ?!?! Haha! 😲

I removed all the old installs of everything in Win10. Then:

  1. Fresh install of Chocolately
  2. choco install python2
  3. pip ... Nope. pip isn't in the system path? O_o
  4. Searching for pip...
  5. c:\tools\python2\scripts\pip install fonttools
  6. python
  7. Test fonttools: import fontTools print fonTools.version "3.0" good.
  8. cd .\EmojiOneColor-SVGinOT-Win-1.3\
  9. .\install.cmd
FontTools 3.x is not available in PATH. Is it installed?
https://github.com/behdad/fonttools
Installation failed!

Adding C:\tools\python2\Scripts to my PATH makes everything work. Nice script!

We need this to work "out of the box". Step by step for the non-experienced user. Can you add more details to the install process in the README.md? I'd recommend Chocolatey to get people using it.

Side note: Powershell is so slow. Just typing dir and waiting for it to think about it. I'll stay with cmd.exe I guess? I'm actually quite surprised.

@yincrash
Copy link
Contributor Author

yincrash commented Jul 18, 2016

Ahhh. I installed python using the installer from python.org. That's really unfortunate the Chocolatey package does not include the scripts folder in the path. Would you recommend just ensuring those directions in the README or try to handle some of these different cases in the script?

@13rac1
Copy link
Owner

13rac1 commented Jul 18, 2016

I'll uninstall and try it again with the python.org installer. Chocolatey just runs the installer, it shouldn't make a difference.

@13rac1
Copy link
Owner

13rac1 commented Jul 18, 2016

I setup a fresh win10 VM (https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/) and installed the current Python 2.7 from python.org. I found the cause of this problem:
Path not default
The path isn't automatically set and it's "below the fold" so the majority of inexperienced users aren't going to select it.

I've discovered Chocolatey will set the path correctly if the easy.install package is installed.

choco install python2
choco install easy.install

I'm trying to figure out a long term straightforward solution for this. I've looked PyInstaller, but that seems overkill. I tested installing Fonttools from git:

pip install git+git://github.com/behdad/fonttools.git

It gets the current repo version which has your fixes We could avoid packaging the generate_cmap4_from_12.py script this way.

This is all just notes. Nothing actionable.

Solution? Best thing right now is a step-by-step install process. The Linux manual install process, for example, includes everything needed. It's just a copy/paste. We need something similar for Windows.

Thanks for your work on this! I need this entire process tested, documented and polished since I need to support this going forward. Thanks for understanding 😄

@yincrash
Copy link
Contributor Author

I totally understand. Time spent getting it right now, means less time dealing with users who don't get it right when trying to install.

What about just having the script install the FontTools from git source and ensure the scripts directory is in the path?

@13rac1
Copy link
Owner

13rac1 commented Jul 18, 2016

What about just having the script install the FontTools from git source

Yes. Sounds easier to maintain. It's possible to avoid a dependency on git.:

pip install https://github.com/behdad/fonttools/archive/master.zip

and ensure the scripts directory is in the path?

Yes. It could be temporarily added.

Rough draft of instructions:

  1. Download Python 3 for windows: https://www.python.org/downloads/
  2. Install the MSI (include path add details?)
  3. Download EmojiOne Color font from releases: https://github.com/eosrei/emojione-color-font/releases
  4. Unzip the file
  5. Open an Administrator CMD.exe
  6. cd to uncompressed EmojiOneColor directory
  7. pip install https://github.com/behdad/fonttools/archive/master.zip
  8. install.cmd This will take some time. Install the new fonts when requested.
  9. Done!

Still so complex...

@yincrash
Copy link
Contributor Author

I don't think it's necessary to run an Administrator command prompt. The font viewer should have a little admin permission request box when attempting to install fonts.

@13rac1
Copy link
Owner

13rac1 commented Jul 18, 2016

Oh good point. I was thinking it was needed for pip, but no.

@yincrash
Copy link
Contributor Author

Okay, I'll edit the script to temporarily set the PATH variable, and run the pip install as well. That will remove step 7.

@13rac1 13rac1 added this to the v1.3 milestone Jul 19, 2016
@yincrash
Copy link
Contributor Author

I can tackle this tomorrow. Things have been busy, and I want to test and make sure it will work the correctly. :)

@yincrash
Copy link
Contributor Author

Ugh. So, unfortunately, a foolproof way of determining where python is installed if it is not on the PATH is not easy, but it is completely outlined in PEP 514. There is a small app that we could bundle (created by python devs and BSD 2-clause licensed) to do this work for us of determining the install location. However, I think this is a bit overkill, but doing the search in the install script will also be very difficult, and not pretty looking at all.

It might just make more sense to check if python is available on the PATH, and if it isn't, instruct the user to add it to the PATH (as a message in the install script when it exits on error).

Suggestions?

@13rac1
Copy link
Owner

13rac1 commented Jul 24, 2016

In Windows 10: I've tried installing Python2 via Chocolately and the installer, then Python3 via Chocolately and the the installer. Chocolately with Python3 gets close to useful. python and pip work out of the box, but Chocolatey adds links to the specific executables only. Installing fonttools results in a non-accessible ttx.

The best option is Python 3 with the regular installer. The user needs to specifically check the install to path, then python and pip are added to the path:
Add python/pip to path

Having Python and Pip in the path should be a hard requirement.

  • Python.exe not found, install or add to PATH.
  • Pip.exe not found, install or add to PATH.

The instructions would say to install the most recent Python3, then install.cmd can just fail with the above errors if not found.

Edit:
The install.cmd should install fonttools, then check for ttx.exe and fail if not found.

@13rac1
Copy link
Owner

13rac1 commented Jul 24, 2016

Second draft of instructions:

  1. Download the most recent Python 3 for Windows: https://www.python.org/downloads/windows/ (It would be neat if we could figure out their OS detection URL and just link that)
  2. Start the installer, select "Add Python 3.5 to PATH" and finish the install process.
  3. Download EmojiOne Color font from releases: https://github.com/eosrei/emojione-color-font/releases
  4. Uncompress the file
  5. Open the new EmojiOneColor directory
  6. Run install.cmd. Note: This will take some time.
  7. Install the new fonts when requested.
  8. Done!

@yincrash
Copy link
Contributor Author

Install script now checks for python and pip, then installs the master.zip of FontTools. Removed the cmap script now that we no longer need it. Updated the README


ECHO Ensuring the latest FontTools is installed.

pip install --upgrade https://github.com/behdad/fonttools/archive/master.zip
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a call to WHERE for ttx? Might as well just check that after the fonttools install, confirms everything is working.

Otherwise this is looking really good! Thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I'll rebuild everything and check it tonight on Win10

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 13rac1#15
@13rac1 13rac1 merged commit 2e10566 into 13rac1:master Jul 25, 2016
@13rac1
Copy link
Owner

13rac1 commented Jul 25, 2016

I've tested install and uninstall in Windows 10. Everything seems to be working, even the new power symbols! ⏻ ⏼ ⏽ ⭘ ⏾

I'm happy to merge this as-is now. 😄 Great work!

Separate/additional questions:

  1. Would it be possible to automatically install the fonts using this method? http://windowsitpro.com/scripting/trick-installing-fonts-vbscript-or-powershell-script
  2. Could you make a PR against https://github.com/eosrei/twemoji-color-font for the same thing? Let me know, thank you.

@yincrash
Copy link
Contributor Author

Hmm. Yeah, that should work. Both the VBS and PS method should work fine. For eosrei/twemoji-color-font, can you make an issue and assign it to me? I can handle it, but it might be in a week or two (or this week if I'm lucky).

@13rac1
Copy link
Owner

13rac1 commented Jul 25, 2016

Cool!

I didn't want to wait any longer! https://github.com/eosrei/emojione-color-font/releases/tag/v1.3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants