Text-Editor icon indicating copy to clipboard operation
Text-Editor copied to clipboard

fixed invalid index type Arial on line 86 dpad.py

Open SairajK19 opened this issue 4 years ago • 7 comments

On line 86 it gives the following error: Traceback (most recent call last): File "dpad.py", line 86, in font_box.current(font_tuple.index("Arial")) ValueError: tuple.index(x): x not in tuple

There is no Arial font in the font_tuple variable ('fangsong ti', 'fixed', 'clearlyu alternate glyphs', 'courier 10 pitch', 'open look glyph', 'bitstream charter', 'song ti', 'open look cursor', 'newspaper', 'clearlyu ligature', 'mincho', 'clearlyu devangari extra', 'clearlyu pua', 'clearlyu', 'clean', 'nil', 'clearlyu arabic', 'clearlyu devanagari', 'gothic', 'clearlyu arabic extra') I printed the above type and checked.

Have set the index value to "fangsong ti" the first item in the font tuple.

Thankyou

SairajK19 avatar Oct 30 '20 16:10 SairajK19

I think you are not using the Windows Operating System. If you are using linux make sure you install the MS fonts. And i think that Arial Black is the common font for both OS. If you can confirm this you can make changes to the font "Arial Black". @SairajK19

Devansh2005 avatar Oct 30 '20 17:10 Devansh2005

Hello, I tried "Arial Black" too sadly it dosen't support (yes and i do use a linux operating system ie.Ubuntu 20.04) Traceback (most recent call last): File "dpad.py", line 86, in font_box.current(font_tuple.index("Arial Black")) ValueError: tuple.index(x): x not in tuple

SairajK19 avatar Oct 30 '20 17:10 SairajK19

Did you meant "Arial Black" will work if I install MS Font on my system first?

SairajK19 avatar Oct 30 '20 17:10 SairajK19

Yes these fonts will work if you install MS fonts in Linux

Devansh2005 avatar Oct 30 '20 17:10 Devansh2005

Yes I tried to install MS Font on my system and it's already on its newest version PS: Reading package lists... Done Building dependency tree
Reading state information... Done ttf-mscorefonts-installer is already the newest version (3.7ubuntu6).

I then again tried executing the python file and it dosent work.Throwing the same error: Traceback (most recent call last): File "dpad.py", line 86, in font_box.current(font_tuple.index("Arial Black")) ValueError: tuple.index(x): x not in tuple

I actually have Arial Font on my system as I can use it on my LibreOffice Writer (same as Office Word on Linux).So i don't really think thats the issue.

SairajK19 avatar Oct 30 '20 17:10 SairajK19

Yeah ! let both of us try to find the solution for this error if we can have a default font that can work on every OS

Devansh2005 avatar Oct 30 '20 17:10 Devansh2005

okay cool!.

SairajK19 avatar Oct 30 '20 17:10 SairajK19