emacs font:已安装字体但无法在emacs中设置

时间:2016-08-29 16:30:20

标签: emacs fonts

我在我的linux(CentOS 6)中安装了字体“Incosolata”,我可以将此字体设置为终端的默认字体。

然后我在我的.emacs文件中添加:GpsPosition pos = g.GetPosition(TimeSpan.Zero);

当emacs(24.5)启动时,会显示:

 /// <summary>
        /// Get the position reported by the GPS receiver that is no older than
        /// the maxAge passed in
        /// </summary>
        /// <param name="maxAge">Max age of the gps position data that you want back. 
        /// If there is no data within the required age, null is returned.  
        /// if maxAge == TimeSpan.Zero, then the age of the data is ignored</param>
        /// <returns>GpsPosition class with all the position details</returns>
        public GpsPosition GetPosition(TimeSpan maxAge)
        {
            GpsPosition gpsPosition = null;
            if (Opened)
            {
                // allocate the necessary memory on the native side.  We have a class (GpsPosition) that 
                // has the same memory layout as its native counterpart
                IntPtr ptr = Utils.LocalAlloc(Marshal.SizeOf(typeof(GpsPosition)));

                // fill in the required fields 
                gpsPosition = new GpsPosition();
                gpsPosition.dwVersion = 1;
                gpsPosition.dwSize = Marshal.SizeOf(typeof(GpsPosition));

                // Marshal our data to the native pointer we allocated.
                Marshal.StructureToPtr(gpsPosition, ptr, false);

                // call native method passing in our native buffer
                int result = GPSGetPosition(gpsHandle, ptr, 500000, 0);
                if (result == 0)
                {
                    // native call succeeded, marshal native data to our managed data
                    gpsPosition = (GpsPosition)Marshal.PtrToStructure(ptr, typeof(GpsPosition));

                    if (maxAge != TimeSpan.Zero)
                    {
                        // check to see if the data is recent enough.
                        if (!gpsPosition.TimeValid || DateTime.Now - maxAge > gpsPosition.Time)
                        {
                            gpsPosition = null;
                        }
                    }
                }
                else if (result == 87) // ERROR_INVALID_PARAMETER)
                {
                    // 
                    // TEMPORARY HACK
                    // 
                    //  http://blogs.msdn.com/cenet/archive/2007/12/06/gpsid-problem-workaround-on-recent-wm6-release.aspx
                    // 

                    Utils.LocalFree(ptr);

                    // allocate the necessary memory on the native side.  We have a class (GpsPosition) that 
                    // has the same memory layout as its native counterpart
                    ptr = Utils.LocalAlloc(376);

                    // fill in the required fields 
                    gpsPosition = new GpsPosition();
                    gpsPosition.dwVersion = 1;
                    gpsPosition.dwSize = 376;

                    // Marshal our data to the native pointer we allocated.
                    Marshal.StructureToPtr(gpsPosition, ptr, false);

                    // call native method passing in our native buffer
                    result = GPSGetPosition(gpsHandle, ptr, 500000, 0);

                    if (result == 0)
                    {
                        // native call succeeded, marshal native data to our managed data
                        gpsPosition = (GpsPosition)Marshal.PtrToStructure(ptr, typeof(GpsPosition));

                        if (maxAge != TimeSpan.Zero)
                        {
                            // check to see if the data is recent enough.
                            if (!gpsPosition.TimeValid || DateTime.Now - maxAge > gpsPosition.Time)
                            {
                                gpsPosition = null;
                            }
                        }
                    }
                }

                // free our native memory
                Utils.LocalFree(ptr);
            }

            return gpsPosition;          
        }

并在options-&gt;设置默认字体...,我也找不到“Inconsolata”。

我错过了任何选项吗? 我应该进行一些设置让emacs识别这种字体吗?

非常感谢你的帮助!

update_0: 我试过了,但没有工作:

(set-default-font "Inconsolata")

他们尝试过这种方法,但仍无效:

error: Font not available, # font-spec nil nil Inconsolata nil nil nil nil nil nil nil nil nil ((:name . Inconsolata) (user-spec . Inconsolata))

update_1: 这是我安装字体的方式

(setq initial-frame-alist '(
  (font . "Inconsolata-14")
))
(setq default-frame-alist '(
  (font . "Inconsolata-14")
  ))

使用fc-list:family,我可以看到有字体Incosolata

0 个答案:

没有答案