keremciu / sketch-iconfont

This plugin helps you easily insert and manage icons from icon fonts.
1.97k stars 102 forks source link

Unicode code for the font is not saved in readable format for developers #174

Closed ghost closed 4 years ago

ghost commented 5 years ago

Please can you assist- when adding the fonts to sketch the code of the font is not saved in a format we can read. Please can you indicate what encoding you used when wrong the font “Unicode” code to the object

Urgent

keremciu commented 5 years ago

can you share a screenshot for this one? it's hard to understand what's not readable

ghost commented 5 years ago

thanks so much for quick response.

attached is screenshot of the specific layers sketchapp JSON extract. Your addin creates the object and sets a "string" - the string is not eligible.

image
ghost commented 5 years ago

cab you confirm if the unicode from the Json is being saved into the "string" field.

image
ghost commented 5 years ago

extract from your ionics.json file.

image
ghost commented 5 years ago

Any chance you figured out the issue? From what I can tell from javascript you are saving a code. We need the Unicode saved that matches your .json files Unicode

keremciu commented 5 years ago

yep but what would you like to have for developers? changing them into different format? I don't know if you convert them it will be named icon

ghost commented 5 years ago

Just plain text like : string: ef56

Exactly per your .json files Unicode values

No encoding just plain readable text.

Is this possible?

keremciu commented 5 years ago

yep it should be possible but it looks like a lot of work for a small challenge :/

ghost commented 5 years ago

If you can’t fix it can you at least tell me what you are saving into that string when you add it to sketch app? If I know the encoding I can try decode it. How do you identify the icon when user selects icon details in sketch app?

Sent from Outlookhttp://aka.ms/weboutlook


From: Kerem Sevencan notifications@github.com Sent: Friday, June 14, 2019 6:50 PM To: keremciu/sketch-iconfont Cc: Fun stuff; Author Subject: Re: [keremciu/sketch-iconfont] Unicode code for the font is not saved in readable format for developers (#174)

yep it should be possible but it looks like a lot of work for a small challenge :/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/keremciu/sketch-iconfont/issues/174?email_source=notifications&email_token=ADGVYLAPOK4MGHMBGNRBJDLP2NLVRA5CNFSM4HXEXUY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXWFFZA#issuecomment-502026980, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADGVYLHXIIDW33522FFPZL3P2NLVRANCNFSM4HXEXUYQ.

keremciu commented 5 years ago

@mdonogma yep I'd like to help but I need to see the whole process you went through.

In the screenshot, If you change your text font to icon font-family then it will show the icon but you'd like to grab icon name from sketch file, right? I can give it a try about this, how about the name of the icon layer?

ghost commented 5 years ago

I only use the menu to insert new icon. You plug-in creates new menu which pops up a dialog, I search for icon using your dialog then double click the one it should insert. It then inserts new icon onto the page.

I never start with existing text layer just insert new from your dialog.

Using the name isn’t the best as user could chane the name of the layer in sketch.

Your javascript appears to insert / assign a value to “string” when inserting the icon. Why not just ensure it is plain text when setting that value.

How does your toolbar know which icon is selected when using show icon details from your menu option? It’s using something unique right? Not the name but something you’ve set when first adding the icon to the layer?

Really appreciate your help .

ghost commented 5 years ago

I think sketchapp is setting the value I showed in the screenshot. Sorry for wasting your time. I just need to figure out how to decode the hex from the Jobject

Thx again

keremciu commented 5 years ago

It was hard to imagine the process, I'm sorry about couldn't help about this point but yes, I built this unicode check inside, https://github.com/keremciu/sketch-iconfont/blob/master/iconfont.sketchplugin/Contents/Sketch/learn.js#L22

I hope you can find a good way to handle this stuff

@mdonogma

keremciu commented 4 years ago

I'm closing this while this is not related to the plugin