Skip to content
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

Shipping and using DejaVu font on Ms-Windows #269

Closed

Conversation

Lucarda
Copy link
Contributor

@Lucarda Lucarda commented Dec 7, 2017

This PR is fully described here:
http://lucarda.com.ar/x/dejavu/readme.html

This is for loading dejavu font on Ms-Windows
@umlaeute
Copy link
Contributor

umlaeute commented Dec 7, 2017

as I find little use in having to click another time to see what this PR is about, I copy it here verbatim:

This is intended for Miller's builds on ms-windows adding the fonts and TWAPI to his compressed files on "pdprototype.tgz" that is included on the [MSW folder](https://github.com/pure-data/pure-data/tree/master/msw of the Pd-sources

Decompressing "pdprototype.tgz" we get a lot of ingredients on the cake and we are adding a couple of cherrys to it on the "lib" folder:

Tcl8.5 (existing folder)
Tk8.5 (existing folder)
DejaVuSansMono.ttf
DejaVuSansMono-Bold.ttf
twapi_base.dll
LICENSE-twapi

Then we add this lines to "pd-gui.tcl" just below "win32" for the proc init_for_platform {} at the time of writing on line 365:

Adding dejavu fonts on mswindows

package require twapi
twapi::AddFontResourceEx lib/DejaVuSansMono.ttf
twapi::AddFontResourceEx lib/DejaVuSansMono-Bold.ttf

This pd-gui.tcl does not crash other OS but will crash Windows if TWAPI is not there. I've tested it and the crash nicely reports the offending line of pd-gui.tcl.

This will deploy Dejavu font on the ZIP version and also the Installer version. I can't test the latter.

It is easy to implement and very easy to throw away if no longer needed.

Copy link
Contributor

@umlaeute umlaeute left a comment

Choose a reason for hiding this comment

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

please catch any errors.

tcl/pd-gui.tcl Outdated
package require twapi
twapi::AddFontResourceEx lib/DejaVuSansMono.ttf
twapi::AddFontResourceEx lib/DejaVuSansMono-Bold.ttf
#
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be protected by a catch clause.

if twapi isn't there (for whatever reasons), Pd is still perfectly usable, so there's little use in erroring out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My tcl is just trial and error, I'm not a programer. Could you do it? or tell me how to?

Anyway I have to commit a missing file on the "pdprototype.tgz" which is causing a Windows crash.

"pkgIndex.tcl"

I just did a build of this PR and got the error.

: - )

@Lucarda
Copy link
Contributor Author

Lucarda commented Dec 8, 2017

Ok I added a catch clause and other stuff to pd-gui.tcl and changes to “pdprototype.tgz”

Now the font files are placed on the pd/bin directory.

@umlaeute
Copy link
Contributor

umlaeute commented Dec 8, 2017

this might just be nitpicking, but if I were to accept the PR, I'd suggest you don't change both source-code (the tcl-file) and opaque binaries (the tgz) in a single commit.

(but then: the PR must be accepted by miller not me - he might think differently)

@Lucarda
Copy link
Contributor Author

Lucarda commented Dec 8, 2017

@umlaeute

the PR must be accepted by miller not me - he might think differently)

I hope so because I can't figure out how to undone the commits (I'm rather new to GIT).

Can you review the changes you requested?

@Lucarda Lucarda closed this Dec 8, 2017
@Lucarda Lucarda deleted the Using-DejaVu-font-on-Ms-Windows branch December 8, 2017 18:32
@Lucarda
Copy link
Contributor Author

Lucarda commented Dec 8, 2017

@umlaeute
I did a new PR #270 with all your requested changes.
Can you review it?
: - )

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

Successfully merging this pull request may close these issues.

None yet

2 participants