From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ng, Andrew" Newsgroups: gmane.emacs.bugs Subject: Emacs 22.1 Windows ClearType Support Date: Thu, 22 Nov 2007 10:51:24 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C82D1F.7AB72653" X-Trace: ger.gmane.org 1195764844 1077 80.91.229.12 (22 Nov 2007 20:54:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Nov 2007 20:54:04 +0000 (UTC) To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 22 21:54:11 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IvJ3n-0004wm-Pp for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Nov 2007 21:54:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IvJ3Z-0007VB-Kq for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Nov 2007 15:53:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IvEKd-0004En-O3 for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2007 10:51:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IvEKb-0004EL-99 for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2007 10:51:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IvEKa-0004EG-W3 for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2007 10:51:09 -0500 Original-Received: from irp2.ptc.com ([12.11.148.84]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IvEKa-0006qA-3A for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2007 10:51:08 -0500 X-IronPort-AV: E=Sophos;i="4.21,452,1188792000"; d="scan'208";a="4825929" Original-Received: from hq-ex3fe2.ptcnet.ptc.com ([132.253.201.63]) by irp2.ptc.com with ESMTP; 22 Nov 2007 10:51:04 -0500 Original-Received: from HQ-MAIL3.ptcnet.ptc.com ([132.253.202.90]) by HQ-EX3FE2.ptcnet.ptc.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 22 Nov 2007 10:51:00 -0500 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: Emacs 22.1 Windows ClearType Support Thread-Index: AcgtH4jh8q9WrvztS6uHkPEgf4wmYg== X-OriginalArrivalTime: 22 Nov 2007 15:51:00.0938 (UTC) FILETIME=[7AE8EAA0:01C82D1F] X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Thu, 22 Nov 2007 15:53:46 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17044 Archived-At: This is a multi-part message in MIME format. ------_=_NextPart_001_01C82D1F.7AB72653 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have been having a go at fixing up the issues related to ClearType in Emacs 22.1. I think I have pretty much sorted out the major issues and everything appears to work fine now. I've tried as much as possible not to alter the non-ClearType code path. I've also added an environment variable "EMACS_CLEARTYPE". If present this will disable ClearType if its value is 0 and will enable ClearType if its value is non-zero. Otherwise, ClearType is enabled according to the system settings. I've attached a patch file for my changes. Thank you. Regards, Andrew Ng ------_=_NextPart_001_01C82D1F.7AB72653 Content-Type: application/octet-stream; name="patchfile" Content-Transfer-Encoding: base64 Content-Description: patchfile Content-Disposition: attachment; filename="patchfile" ZGlmZiAtdSBlbWFjcy0yMi4xLW9yaWcvc3JjL2Rpc3BuZXcuYyBlbWFjcy0yMi4xL3NyYy9kaXNw bmV3LmMKLS0tIGVtYWNzLTIyLjEtb3JpZy9zcmMvZGlzcG5ldy5jCTIwMDctMDQtMTYgMTc6MjE6 MTguMDAwMDAwMDAwICswMTAwCisrKyBlbWFjcy0yMi4xL3NyYy9kaXNwbmV3LmMJMjAwNy0xMS0y MiAxNDoyNjo0NC4xODc1MDAwMDAgKzAwMDAKQEAgLTQ1MjMsOCArNDUyMyw4IEBACiAJICAgICAg aWYgKG92ZXJsYXBwaW5nX2dseXBoc19wCiAJCSAgJiYgaSA+IDAKIAkJICAmJiBpIDwgY3VycmVu dF9yb3ctPnVzZWRbVEVYVF9BUkVBXQotCQkgICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FS RUFdCi0JCSAgICAgICE9IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKQorCQkgIC8qJiYg KGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKwkJICAgICAgIT0gZGVzaXJlZF9yb3ctPnVz ZWRbVEVYVF9BUkVBXSkqLykKIAkJewogCQkgIGludCBsZWZ0LCByaWdodDsKIApkaWZmIC11IGVt YWNzLTIyLjEtb3JpZy9zcmMvdzMyZm5zLmMgZW1hY3MtMjIuMS9zcmMvdzMyZm5zLmMKLS0tIGVt YWNzLTIyLjEtb3JpZy9zcmMvdzMyZm5zLmMJMjAwNy0wMy0yNCAxNTo0OTo0OC4wMDAwMDAwMDAg KzAwMDAKKysrIGVtYWNzLTIyLjEvc3JjL3czMmZucy5jCTIwMDctMTEtMjAgMTA6MDM6MTMuMTcx ODc1MDAwICswMDAwCkBAIC00NTQ2LDYgK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 MzJfY29tcHV0ZV9nbHlwaF9zdHJpbmdfb3ZlcmhhbmdzIChzKQogICAgICBzdHJ1Y3QgZ2x5cGhf c3RyaW5nICpzOwogewotICAvKiBUT0RPOiBXaW5kb3dzIGRvZXMgbm90IGFwcGVhciB0byBoYXZl IGEgbWV0aG9kIGZvcgotICAgICBnZXR0aW5nIHRoaXMgaW5mbyB3aXRob3V0IGdldHRpbmcgdGhl IEFCQyB3aWR0aHMgZm9yIGVhY2gKLSAgICAgaW5kaXZpZHVhbCBjaGFyYWN0ZXIgYW5kIHdvcmtp bmcgaXQgb3V0IG1hbnVhbGx5LiAqLworICBpZiAocy0+Y21wID09IE5VTEwKKyAgICAgICYmIHMt PmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICYmIHMtPm5jaGFycyA+IDAp CisgICAgeworICAgICAgWEZvbnRTdHJ1Y3QgKmZvbnQgPSBzLT5mb250OworICAgICAgY29uc3Qg aW50ICAgIGZvbnRfdHlwZSA9IHMtPmZpcnN0X2dseXBoLT5mb250X3R5cGU7CisKKyAgICAgIHdj aGFyX3QgICp3cyA9IHMtPmNoYXIyYjsKKyAgICAgIGNvbnN0IGludCBuYyA9IHMtPm5jaGFyczsK KyAgICAgIGludCAgICAgICBpLCBwb3MsIG1uLCBteDsKKyAgICAgIGlmIChuYyA9PSAxKQorICAg ICAgICB7CisgICAgICAgICAgWENoYXJTdHJ1Y3QgKnBjbSA9IHczMl9wZXJfY2hhcl9tZXRyaWMg KGZvbnQsIHdzLCBmb250X3R5cGUpOworCisgICAgICAgICAgcy0+cmlnaHRfb3ZlcmhhbmcgPSBw Y20tPnJiZWFyaW5nID4gcGNtLT53aWR0aCA/IHBjbS0+cmJlYXJpbmcgLSBwY20tPndpZHRoIDog MDsKKyAgICAgICAgICBzLT5sZWZ0X292ZXJoYW5nICA9IHBjbS0+bGJlYXJpbmcgPCAwID8gLXBj bS0+bGJlYXJpbmcgOiAwOworICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICBw b3MgPSBtbiA9IG14ID0gMDsKKyAgICAgIGZvciAoaSA9IDA7IGkgPCBuYzsgKytpLCArK3dzKQor ICAgICAgICB7CisgICAgICAgICAgWENoYXJTdHJ1Y3QgKnBjbSA9IHczMl9wZXJfY2hhcl9tZXRy aWMgKGZvbnQsIHdzLCBmb250X3R5cGUpOworCisgICAgICAgICAgY29uc3QgaW50IHJwID0gcG9z ICsgcGNtLT5yYmVhcmluZzsKKyAgICAgICAgICBjb25zdCBpbnQgbHAgPSBwb3MgKyBwY20tPmxi ZWFyaW5nOworCisgICAgICAgICAgaWYgKHJwID4gbXgpIG14ID0gcnA7CisgICAgICAgICAgaWYg KGxwIDwgbW4pIG1uID0gbHA7CisKKyAgICAgICAgICBwb3MgKz0gcGNtLT53aWR0aDsKKyAgICAg ICAgfQorCisgICAgICBzLT5yaWdodF9vdmVyaGFuZyA9IG14ID4gcG9zID8gbXggLSBwb3MgOiAw OworICAgICAgcy0+bGVmdF9vdmVyaGFuZyAgPSBtbiA8IDAgPyAtbW4gOiAwOworICAgIH0KIH0K IAogCkBAIC0xNTM2LDcgKzE1NzAsNyBAQAogeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5k IChzKQogICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzOwogewotICBpbnQgaSwgeDsKKyAgaW50 IGksIHgsIGN0X2NsZWFyID0gMDsKICAgSEZPTlQgb2xkX2ZvbnQ7CiAKICAgLyogSWYgZmlyc3Qg Z2x5cGggb2YgUyBoYXMgYSBsZWZ0IGJveCBsaW5lLCBzdGFydCBkcmF3aW5nIHRoZSB0ZXh0CkBA IC0xNTUwLDcgKzE1ODQsMTUgQEAKICAgaWYgKHMtPmZvcl9vdmVybGFwcyB8fCAocy0+YmFja2dy b3VuZF9maWxsZWRfcCAmJiBzLT5obCAhPSBEUkFXX0NVUlNPUikpCiAgICAgU2V0QmtNb2RlIChz LT5oZGMsIFRSQU5TUEFSRU5UKTsKICAgZWxzZQotICAgIFNldEJrTW9kZSAocy0+aGRjLCBPUEFR VUUpOworICB7CisgICAgaWYgKGNsZWFydHlwZV9hY3RpdmUpCisgICAgICB7CisgICAgICAgIGN0 X2NsZWFyID0gMTsKKyAgICAgICAgU2V0QmtNb2RlIChzLT5oZGMsIFRSQU5TUEFSRU5UKTsKKyAg ICAgIH0KKyAgICBlbHNlCisgICAgICBTZXRCa01vZGUgKHMtPmhkYywgT1BBUVVFKTsKKyAgfQog CiAgIFNldFRleHRDb2xvciAocy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCk7CiAgIFNldEJrQ29s b3IgKHMtPmhkYywgcy0+Z2MtPmJhY2tncm91bmQpOwpAQCAtMTU4Niw2ICsxNjI4LDIxIEBACiAg ICAgICAgICAgY2hhcjFiW2ldID0gWENIQVIyQl9CWVRFMiAoJnMtPmNoYXIyYltpXSk7CiAKICAg ICAgIC8qIERyYXcgdGV4dCB3aXRoIFRleHRPdXQgYW5kIGZyaWVuZHMuICovCisgICAgICBpZiAo Y3RfY2xlYXIpCisgICAgICAgIHsKKyAgICAgICAgICBIQlJVU0ggaGI7CisgICAgICAgICAgUkVD VCAgIHI7CisKKyAgICAgICAgICByLmxlZnQgPSB4OworICAgICAgICAgIHIudG9wICA9IHMtPnk7 CisgICAgICAgICAgci5yaWdodCAgPSB4ICsgcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAgICAg ICByLmJvdHRvbSA9IHMtPnkgKyBzLT5oZWlnaHQ7CisKKyAgICAgICAgICBoYiA9IENyZWF0ZVNv bGlkQnJ1c2ggKHMtPmdjLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICBGaWxsUmVjdCAocy0+aGRj LCAmciwgaGIpOworICAgICAgICAgIERlbGV0ZU9iamVjdCAoaGIpOworICAgICAgICB9CisKICAg ICAgIHczMl90ZXh0X291dCAocywgeCwgcy0+eWJhc2UgLSBib2ZmLCBzLT5jaGFyMmIsIHMtPm5j aGFycyk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lzdGVtUGFyYW1ldGVyc0luZm8gKFNQSV9HRVRGT05UU01P T1RISU5HLCAwLCAmc21vb3RoaW5nX2VuYWJsZWQsIDApCi0gICAgICAmJiBzbW9vdGhpbmdfZW5h YmxlZAotICAgICAgJiYgU3lzdGVtUGFyYW1ldGVyc0luZm8gKFNQSV9HRVRGT05UU01PT1RISU5H VFlQRSwgMCwgJnNtb290aGluZ190eXBlLCAwKQotICAgICAgJiYgc21vb3RoaW5nX3R5cGUgPT0g RkVfRk9OVFNNT09USElOR0NMRUFSVFlQRTsKKyAgICAgIGVudiA/IChhdG9pKGVudikgIT0gMCkg OgorICAgICAgICAoU3lzdGVtUGFyYW1ldGVyc0luZm8gKFNQSV9HRVRGT05UU01PT1RISU5HLCAw LCAmc21vb3RoaW5nX2VuYWJsZWQsIDApCisgICAgICAgICAmJiBzbW9vdGhpbmdfZW5hYmxlZAor ICAgICAgICAgJiYgU3lzdGVtUGFyYW1ldGVyc0luZm8gKFNQSV9HRVRGT05UU01PT1RISU5HVFlQ RSwgMCwgJnNtb290aGluZ190eXBlLCAwKQorICAgICAgICAgJiYgc21vb3RoaW5nX3R5cGUgPT0g RkVfRk9OVFNNT09USElOR0NMRUFSVFlQRSk7CiAgIH0KIH0KIAo= ------_=_NextPart_001_01C82D1F.7AB72653--