how to change default persian fonts in arch - linux

I'm new at arch and have a big problem with it and it's Persian fonts are very ugly!
This is in all applications (chrome ,games ,gnome menu etc.).
What I can to do ?
Thanks for your attention.

open ~/.config/fontconfig/fonts.conf (create if not exist)
copy this code and save > for change default font to Vazirmatn (persian font) :
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match>
<edit mode="prepend" name="family">
<string>Vazirmatn</string>
</edit>
</match>
<dir>~/.local/share/fonts</dir>
<dir>/usr/share/fonts/</dir>
</fontconfig>
Vazirmatn must copied to ~/.fonts before .

Related

FFmpeg crashing on drawtext filter (ffmpeg-python)

Hey guys so im trying to use ffmpeg-python to add text to a video but its crashing at
[Parsed_drawtext_0 # 0000012ea115ee80] Setting 'text' to value 'hi'
and I'm not sure what I can do to fix this problem. I tried pure FFmpeg command-line style and still the same issue where it gets stuck at Setting text to value and it simply outputs a 0byte mp4 after crashing.
My code:
os.environ['FONTCONFIG_FILE'] = r'C:\Users\NOP\NOP\NOP\NOP\binaries\fonts\fonts.conf'
os.environ['FONTCONFIG_PATH'] = r'C:\Users\NOP\NOP\NOP\NOP\binaries\fonts'
os.environ['FC_CONFIG_DIR'] = r'C:\Users\NOP\NOP\NOP\NOP\binaries\fonts'
in_ = ffmpeg.input(output_video_logo)
in_ = in_.drawtext(text='hi')
ffmpeg.output(in_, output_video).global_args('-loglevel', 'debug').run(cmd=FFMPEG_PATH)
Font config file:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
<!--
DO NOT EDIT THIS FILE.
IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
LOCAL CHANGES BELONG IN 'local.conf'.
The intent of this standard configuration file is to be adequate for
most environments. If you have a reasonably normal environment and
have found problems with this configuration, they are probably
things that others will also want fixed. Please submit any
problems to the fontconfig bugzilla system located at fontconfig.org
Note that the normal 'make install' procedure for fontconfig is to
replace any existing fonts.conf file with the new version. Place
any local customizations in local.conf which this file references.
Keith Packard
-->
<!-- Font directory list -->
<dir>WINDOWSFONTDIR</dir>
<dir>~/fonts</dir>
<dir prefix="cwd">.</dir>
<dir>~/.fonts</dir>
<!--
Accept deprecated 'mono' alias, replacing it with 'monospace'
-->
<match target="pattern">
<test qual="any" name="family">
<string>mono</string>
</test>
<edit name="family" mode="assign">
<string>monospace</string>
</edit>
</match>
<!--
Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
-->
<match target="pattern">
<test qual="any" name="family">
<string>sans serif</string>
</test>
<edit name="family" mode="assign">
<string>sans-serif</string>
</edit>
</match>
<!--
Accept deprecated 'sans' alias, replacing it with 'sans-serif'
-->
<match target="pattern">
<test qual="any" name="family">
<string>sans</string>
</test>
<edit name="family" mode="assign">
<string>sans-serif</string>
</edit>
</match>
<!--
Load local system customization file
-->
<include ignore_missing="yes">conf.d</include>
<!-- Font cache directory list -->
<cachedir>WINDOWSTEMPDIR_FONTCONFIG_CACHE</cachedir>
<cachedir>~/.fontconfig</cachedir>
<config>
<!--
Rescan configuration every 30 seconds when FcFontSetList is called
-->
<rescan>
<int>30</int>
</rescan>
</config>
</fontconfig>
Is this a issue with any of my fontconfig or script? I'm really lost on fixing this.
As requested by Rotem tried adding new input to drawtext and this was the output before crashing with no error message:
Successfully opened the file.
[Parsed_drawtext_0 # 00000171a2f0f900] Setting 'box' to value '1'
[Parsed_drawtext_0 # 00000171a2f0f900] Setting 'boxcolor' to value 'yellow'
[Parsed_drawtext_0 # 00000171a2f0f900] Setting 'fontcolor' to value 'blue'
[Parsed_drawtext_0 # 00000171a2f0f900] Setting 'fontsize' to value '72'
[Parsed_drawtext_0 # 00000171a2f0f900] Setting 'text' to value 'hi'
[Parsed_drawtext_0 # 00000171a2f0f900] Setting 'x' to value '10'
[Parsed_drawtext_0 # 00000171a2f0f900] Setting 'y' to value '10'
Full log:
https://pastebin.com/E6sHvwUz

Trying to create a handler for .maff files in Linux

MAFF files are simply zip files. I'm trying to create a handler for .maff in linux so that when I click on them or type xdg-open x.maff it will call my handler instead of the default which is to open the directory in nautilus. I created an application-x-maff.xml file that contains:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-maff">
<comment>maff type</comment>
<magic priority="100">
<match offset="0" type="string" value="PK\x03\x04" />
</magic>
<glob pattern="*.maff"/>
</mime-type>
</mime-info>
and saved in ~/.local/share/mime/packages. Created also a ~/.local/share/applications/maffapplication.desktop that contains
[Desktop Entry]
Type=Application
MimeType=application/x-maff
Name=Maff Handler
Exec=<my home path>/bin/linux/maffHandler
and executed
% update-mime-database ~/.local/share/mime/packages/
% update-desktop-database ~/.local/share/applications
If I do
% gio info x.maff (filtered)
standard::content-type: application/x-maff
standard::fast-content-type: application/x-maff
and if I do
% gio mime application/x-maff
Registered applications:
maffapplication.desktop
Recommended applications:
maffapplication.desktop
everything seems to be right ... but then xdg-open x.maff does not work, still calls nautilus ... worse yet, if I do
% xdg-mime query filetype x.maff
application/zip
I'm sure I'm missing something ... somehow I need to override this association between the .maff file that starts with the same magic as a zip file to no avail ... I tried all kinds of modifications on the xml file, with and without the magic, nothing works
By the way, if I do
% maffHandler x.maff
it works perfectly and opens the maff file in firefox, I'm willing to share the C++ code of that if anyone is interested
Seems that TDE (Trinity Desktop) does not properly set two important environment variables
setenv XDG_CURRENT_DESKTOP KDE
setenv KDE_SESSION_VERSION 5
Once they are set at .login (unfortunately had to log out and login again) xdg- scripts started working properly and recognizing the MIME types. The other problem is that TDE requires that you manually add the association on Control Center -> TDE Components -> File Associations.
After environment variables properly set for my environment and File Associations set, then it all works perfectly. Thanks

Coqide 8.5: No syntax highlighting on Linux

I installed Coqide 8.5 w/ nix. Unfortunately, the text is blakc in all panels; there's no syntax highlighting of any kind (otherwise, 8.5 seems a big improvement over 8.4, which I've installed as well). I also get the following:
(coqide:17272): GtkSourceView-WARNING **: Unknown parent scheme 'classic' in scheme 'coq_style'
(coqide:17272): GtkSourceView-WARNING **: Failed to load '/nix/store/2sxcqfc4q3ls4g2q13n1zwfhnydvgq-coq-8.5pl1/share/coq/coq.lang': could not find the RelaxNG schema file
The output of cat ~/.nix-profile/share/coq/coq_style.xml:
<?xml version="1.0" encoding="UTF-8"?>
<style-scheme id="coq_style" _name="Coq highlighting based on Ssr manual"
parent-scheme="classic" version="1.0">
<author>The Coq Dev Team</author>
<_description>Coq/Ssreflect color scheme for the vernacular language</_description>
<style name="coq:comment" foreground="#brown"/>
<style name="coq:coqdoc" foreground="#brown" italic="true"/>
<style name="coq:vernac-keyword" bold="true" foreground="#dark violet"/>
<style name="coq:gallina-keyword" bold="true" foreground="#orange red"/>
<style name="coq:identifier" foreground="#navy"/>
<style name="coq:constr-keyword" foreground="#dark green"/>
<style name="coq:constr-sort" foreground="#008080"/>
<style name="coq-ssreflect:comment" foreground="#b22222"/>
<style name="coq-ssreflect:coqdoc" foreground="#b22222" italic="true"/>
<style name="coq-ssreflect:vernac-keyword" bold="true" foreground="#a021f0"/>
<style name="coq-ssreflect:gallina-keyword" bold="true" foreground="#a021f0"/>
<style name="coq-ssreflect:identifier" bold="true" foreground="#0000ff"/>
<style name="coq-ssreflect:constr-keyword" foreground="#228b22"/>
<style name="coq-ssreflect:constr-sort" foreground="#228b22"/>
<style name="coq-ssreflect:tactic" foreground="#101092"/>
<style name="coq-ssreflect:endtactic" foreground="#ff3f3f"/>
<style name="coq-ssreflect:iterator" foreground="#be6ad4"/>
<style name="coq-ssreflect:string" foreground="#8b2252"/>
</style-scheme>
Given the first warning, I guess there should be something else instead of "classic" but what
I have libgtksourceview3.0-common installed but CoqIDE depends on libgtksourceview2.0-common. Installing the latter fixed it
I just ran into this same issue with coqide installed via nix (in the coq-8.6 package).
Here's a script that installs symlinks to some files in your homedir to work around several warning messages:
## Find the nix-installed version of the GTK SourceView 2.0 library
sourceview="$(nix-env -q coq --no-name --out-path |
xargs nix-store -q --references |
grep -- -gtksourceview-)"
## Link files into the correct hierarchical folders in your home dir:
share=share/gtksourceview-2.0
for file in language-specs/language2.rng \
language-specs/def.lang \
styles/classic.xml
do
target="$HOME/.local/$share/$file"
mkdir -vp "$(dirname "$target")"
ln -vfns "$sourceview/$share/$file" "$target"
done
This fixes the following GtkSourceView-WARNINGs:
## fixed by language-specs/language2.rng
Failed to load '.../share/coq/coq.lang': could not find the RelaxNG schema file
## fixed by language-specs/def.lang
in file .../share/coq/coq.lang: style 'def:comment' not defined
Failed to load '.../share/coq/coq.lang': unable to resolve language 'def'
## fixed by styles/classic.xml
Unknown parent scheme 'classic' in scheme 'coq_style'
I'll likely try to fix the coq derivation at some point to avoid needing this workaround. I suspect either or both of the following would need to be done:
Fix how coq sets up the GTK SourceView search paths (since it includes the language definition)
Fix how gnome2.gtksourceview exports its search path(s) for other programs to use

How can I check for Visual Studio updates via the command line?

In an attempt to streamline my Virtual Environment setup, I'm using Chocolatey to automate my VM.
Since I can run the cinst command to install Visual Studio
c:\> cinst VisualStudio2012Professional
I'm wondering if after it's installed, is there a command line switch to check for (and subsequently "install") updates within Visual Studio?
Something along the lines of...
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" /InstallUpdates
This should also extend to any extensions that are installed along side VS.
There is a way to check but it is not at all straight forward. Visual Studio Updates are published via an ATOM feed that is currently hosted here:
http://go.microsoft.com/fwlink/?LinkID=251032
This URL can be located in:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Platform\Shell\Microsoft.VisualStudio.ExtensionManager.Implementation.pkgdef
Under the [$RootKey$\ExtensionManager\Repositories{52943709-1abb-4abe-b413-41e8bb6d0462}] key.
The above URL should not change for any version of Visual studio BUT that is not a guarantee. If you examine the response of http://go.microsoft.com/fwlink/?LinkID=290886, you will currently get this response:
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text"></title>
<id>uuid:99B94631-1B1A-45A0-9C34-54F75988DD54;id=1</id>
<updated>2013-02-12T20:00:00-07:00</updated>
<entry>
<id>8EAF6C8E-1283-4EEE-AB6E-F0F087BFCBFF</id>
<title type="text">Visual Studio 2012 Update 3</title>
<summary type="text">Includes security updates, other critical updates, hotfixes, and feature packs that have been issued since the product was released.</summary>
<published>2012-12-01T21:00:00-07:00</published>
<updated>2012-12-01T21:00:00-07:00</updated>
<author>
<name>Microsoft Corp.</name>
</author>
<link rel="alternate" type="text/html" href="http://go.microsoft.com/fwlink/?LinkID=257044&clcid=0x409"/>
<link rel="releasenotes" type="text/html" href="http://go.microsoft.com/fwlink/?LinkID=257045&clcid=0x409"/>
<link rel="update" type="text" href="http://go.microsoft.com/fwlink/?LinkID=302339"/>
<!-- icon should be 32 x 32 pixels -->
<link rel="icon" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_32x.png"/>
<!-- preview image should be 200 x 200 pixels -->
<link rel="previewimage" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_200x.png"/>
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010">
<Id>8EAF6C8E-1283-4EEE-AB6E-F0F087BFCBFD</Id>
<Version>11.0.60610.01</Version>
<References />
</Vsix>
</entry>
<entry>
<id>28743233-1A36-4e67-8747-F072F8C76D1F</id>
<title type="text">Visual Studio Extensions for Windows Library for JavaScript</title>
<summary type="text">This release updates the development resources for the controls, CSS styles, and helper functions that are included in the Windows Library for JavaScript.</summary>
<published>2013-08-08T20:00:00-07:00</published>
<updated>2013-08-08T20:00:00-07:00</updated>
<author>
<name>Microsoft Corp.</name>
</author>
<link rel="alternate" type="text/html" href="http://go.microsoft.com/fwlink/?LinkId=260891&clcid=0x409"/>
<link rel="releasenotes" type="text/html" href="http://go.microsoft.com/fwlink/?LinkID=260892&clcid=0x409"/>
<link rel="update" type="text" href="http://go.microsoft.com/fwlink/?LinkID=260893"/>
<link rel="icon" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_32x.png"/>
<link rel="previewimage" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_200x.png"/>
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010">
<Id>Microsoft.WinJS</Id>
<Version>1.0.9200.20789</Version>
<References />
</Vsix>
</entry>
</feed>
Note that there are two entries in this feed and the one you are interested in is the one with a title beginning with "Visual Studio 2012 Update."
If the Version specified in this file (11.0.60610.01 here) is greater than the version you have on disk:
(Get-Item "${env:ProgramFiles(x86)}\Microsoft Visual Studio 11.0\common7\ide\devenv.exe").VersionInfo.ProductVersion
Then you would want to download and install the url in the Link/#Update node:
<link rel="update" type="text" href="http://go.microsoft.com/fwlink/?LinkID=302339"/>
That Url should redirect to an MSI that has the update.
Based on the information located in the Devenv Command Line Switches MSDN documentation. There is currently no way to call a command line swtich in order to check for / install updates to Visual Studio.
however Matt Wrock shows a nice workaround in his answer.
The answer from #Matt is outdated. For VS2019 follow this way:
Download file at https://aka.ms/vs/16/release/channel (it will be plain JSON file 'VisualStudio.16.Release.chman')
Check node: info->productDisplayVersion (or buildVersion) - they give enough info.

Liferay 6.1 Theme - look and feel

I have liferay-look-and-feel.xml file:
<?xml version="1.0"?>
<!DOCTYPE look-and-feel PUBLIC "-//Liferay//DTD Look and Feel 6.1.0//EN"
"http://www.liferay.com/dtd/liferay-look-and-feel_6_1_0.dtd">
<look-and-feel>
<compatibility>
<version>6.1.10+</version>
</compatibility>
<theme id="sample-theme" name="Sample Theme">
<settings>
<setting key="portlet-setup-show-borders-default" value="false" />
</settings>
</theme>
</look-and-feel>
I use maven to build my project and build success
But when I open localhost in Eclipse I see:
[ThemeLocalServiceImpl:149] No theme found for specified theme id sample_WAR_sampletheme. Returning the default theme.
What is wrong?
Just remove the property antiJarLocking and set antiResourceLocking to false in Liferay-6.1.10/tomcat-7.0.27/webapps/sample_WAR_sampletheme/META-INF/context.xml.
Read more here.
It is a problem of antiResourceLocking in tomcat 7.
Please check out the blog: No theme found for specified theme id … Returning the default theme

Resources