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

Activating/Deactivating a Font file #43

Open
YashAgarwal opened this issue Jun 22, 2016 · 10 comments
Open

Activating/Deactivating a Font file #43

YashAgarwal opened this issue Jun 22, 2016 · 10 comments

Comments

@YashAgarwal
Copy link
Contributor

YashAgarwal commented Jun 22, 2016

I can use the following to install a .ttf or .otf file in sugar but I require root access for it

mv path/to/font/file /usr/share/fonts
fc-cache -f -v 

I can use subprocess module to run the commands through my activity but how do I provide it root access or is there another way to do this?

@samdroid-apps
Copy link

Can you use the ~/.fonts directory? That is how I usually install
fonts on my computer :)

On Thu, Jun 23, 2016 at 6:59 AM, Yash Agarwal
notifications@github.com wrote:

I can use the following to install a .ttf or .otf file in sugar but I
require root access for it

mv path/to/font/file /usr/share/fonts
fc-cache -f -v
I can use subprocess module to run the commands through my activity
but how do I provide it root access or is there another to do this?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@YashAgarwal
Copy link
Contributor Author

@samdroid-apps yeah I can, but that folder doesn't exist on my sugar environment, all the fonts were stored in /usr/share/fonts
won't my activity need root for writing to that directory to?

@samdroid-apps
Copy link

No, just create a ~/.fonts directory.

On Thu, Jun 23, 2016 at 8:29 AM, Yash Agarwal
notifications@github.com wrote:

@samdroid-apps yeah I can, but that folder doesn't exist on my sugar
environment, all the fonts were stored in /usr/share/fonts
won't my activity need root for writing to that directory to?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@walterbender
Copy link
Member

You don't need root for -/fonts
On Jun 22, 2016 6:29 PM, "Yash Agarwal" notifications@github.com wrote:

@samdroid-apps https://github.com/samdroid-apps yeah I can, but that
folder doesn't exist on my sugar environment, all the fonts were stored in
/usr/share/fonts
won't my activity need root for writing to that directory to?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#43 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ADz74Um3VEAhwltmEXYGCtd9y9DdvLx2ks5qObc_gaJpZM4I8Nyk
.

@YashAgarwal
Copy link
Contributor Author

oh, thanks @walterbender

@YashAgarwal
Copy link
Contributor Author

if the font file is in /user/share/fonts then I won't be able to deactivate the font file by moving the file out of the folder and running fc-cache -f -v or is there any other way of deactivating font without having root privileges.

@YashAgarwal YashAgarwal reopened this Jun 26, 2016
@davelab6
Copy link
Contributor

@YashAgarwal you should be able to get root with gksudo (http://askubuntu.com/questions/51572/why-should-i-use-gksudo-for-gtk-apps-instead-of-sudo)

However, one of the things Eli and I discussed yesterday in the youtube video is that the editor could by default only deal with UFOs; that means you could avoid dealing with /usr/share/fonts entirely

@davelab6
Copy link
Contributor

davelab6 commented Jul 6, 2016

I believe this is now ready for testing in the next .xo release

@davelab6
Copy link
Contributor

On Ubuntu 14.04, the fonts folder path is ~/.local/share/fonts so we'll need to account for that too.

@davelab6
Copy link
Contributor

Next action is to uncomment this code in PR #74

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

No branches or pull requests

5 participants