ICSharpCode.TextEditor.Ime.SetIMEWindowFont C# (CSharp) Method

SetIMEWindowFont() private method

private SetIMEWindowFont ( Font f ) : void
f System.Drawing.Font
return void
		private void SetIMEWindowFont(Font f)
		{
			if (disableIME || hIMEWnd == IntPtr.Zero) return;
			
			if (lf == null) {
				lf = new LOGFONT();
				f.ToLogFont(lf);
				lf.lfFaceName = f.Name;  // This is very important! "Font.ToLogFont" Method sets invalid value to LOGFONT.lfFaceName
			}

			try {
				SendMessage(
					hIMEWnd,
					WM_IME_CONTROL,
					new IntPtr(IMC_SETCOMPOSITIONFONT),
					lf
				);
			} catch (AccessViolationException ex) {
				Handle(ex);
			}
		}